We can leave this empty for now, as we aren’t doing anything with MIDI data except passing on the notes. In order for this script to not throw errors, let’s go ahead and define our onMidiPort1 function like this: This is your gateway to creating interesting interactions using functions, conditionals, and other fun stuff, which we will talk about later. This will call the onMidiPort1 function (which we haven’t defined yet) whenever an event happens on the specified MIDI port (which is defined by the host.getMidiInPort(0) bit). Basically, we create a MIDI callback that takes a function as an argument (onMidiPort1 in this case). The MIDI callback isn’t needed now, but it’s a useful thing to setup. The Note input (as you may have guessed) allows us to get MIDI notes to Bitwig’s synths or third party VSTs. In this case we want to create our note input and a MIDI callback. This function is called whenever we load the script and sets things up for us. We’ll add a few functions to our script inside of the init() function. It won’t do anything yet, but we can quickly change that with a few more lines of code. You can then assign a controller to the MIDI input and MIDI output of the script. If you save this file you should be able to open Bitwig, navigate to the controller preferences, and select your new script from the ‘Add controller manually’ menu. In this case I want one input and one output. After that we define the number of input and output ports. It’s some sort of hardware identifier, that I’m still not totally clear on (just generate one and put it as the fourth argument of this function, ok?). In the fineController function, we let Bitwig know what company makes the controller, what the actual device is, the version number, and a UUID. First we need to initialize the API, define our script, and define the inputs and outputs. There are a few lines of code that every script needs to have at the top to initialize the script and make the connections. Now we’re ready to start writing some code. Create a new file in your text editor of choice and save it inside our newly created folder with a name of ‘M圜’. You can use any text editor you like, but one that supports js development will be helpful. Once our folder is created we need to create a javascript file. Inside of ’M圜ompany’, create a folder that will hold the control script for our device, I’ll call it ‘M圜ontroller’. I’ll use ‘M圜ompany’ as the name of this folder. Once there, create a new folder for the manufacturer of the controller and give it a name. Windows: %USERPROFILE%\Documents\Bitwig Studio\Controller Scripts\ Mac: Documents/Bitwig Studio/Controller Scripts Let’s get to it! First, let’s make two folders in our Controller Scripts folder in our Bitwig User directory. You can also access the API documentation from the Help menu in Bitwig. You can use Codecademy to get up to speed with JavaScript pretty quickly if you’re interested, or you can consult the Mozilla Developer Network to get a more thorough walkthrough. That being said, I’d never really used JavaScript before diving into control scripting, so this might be a good place to get your feet wet with text based coding. These scripts don’t involve anything too complex or any hardcore programming tricks, but it will be much easier to follow along if you have a frame of reference. Thankfully, there are some generic scripts that are included with Bitwig that allow for note input and cc mappings, as well as quite a few scripts for popular controllers.īefore we begin, it’s worth mentioning that it would be helpful if you know at least a little bit of JavaScript, or another C-based language. This makes writing control scripts a much faster and easier process, which is very good, because in order to do anything with a controller in Bitwig, you’ll need a script. Bitwig Studio on the other hand, has a completely documented scripting API, and a debugging console built into the application. Live is great, and I still use it for a most of my sound making and performing, but coding scripts without documentation, or a convenient way of debugging, makes it a laborious, and sometimes frustrating experience. In this series of articles we will walk through the creation of a basic controller script for Bitwig Studio. Coming from an environment like Ableton Live, which has an undocumented and ‘closed’ API, this was hugely exciting. In promotions for the software they always mentioned that they would have an ‘Open Controller Scripting API’. When I first heard about Bitwig Studio years ago, there was one feature that really caught my eye. Posted May 13th, 2015 by Evan Bogunia & filed under Bitwig Studio, Blog, Tutorials.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |