Getting custom open sound control (link has been down for a while…) messages to properly trigger MIDI events in OSCulator is not as simple as it might look like. Since I made good progress in the last few days (with the gracious help of Camille Troillard, the author of the software), I though I’d share some of my findings.
OSCulator is a tool mostly designed to bridge OSC compatible hardware (and various other controllers such as the Wiimote) to software. I myself use it primarily as an OSC-to-MIDI bridge and it works quite well for that purpose. However, getting a working setup is a bit more involved than I had expected. Here’s a primer on how to quickly get started.
First of all, you need to decide upon a syntax to use for the OSC messages. That’s important because if you do not do it right, you’ll end up wasting a lot of time like I did. See, instead of inventing my own syntax, I thought it would be a good idea to follow some agreed upon de facto standard. The only one I found was the one described on the web site of a similar tool called Occam. It uses messages such as :
- /osc/midi/out/noteOn channel(int) key(int) velocity(int)
- /osc/midi/out/noteOff channel(int) key(int) velocity(int)
- /osc/midi/out/control channel(int) index(int) value(int)
As it turned out, this syntax did not play well in OSCulator. The reason is that OSCulator cannot extract parameters from the address pattern (the slash-separated first part). So instead I had to use something like that :
- /hpm/1/note number(int) velocity(int) action(int)
The logic here is that the 3rd parameter (action) can either be 1 (note on) or 0 (note off). At first, I thought I could use the strings ‘on‘ and ‘off‘ but OSCulator can only use numerical parameters. I also thought to make the action parameter the first one but Camille advised against it. It seems preferable that the note and velocity are defined before the actual action is called.
The /hpm part is only there to identify my project which is called HPM. The number 1 in the address pattern (/hpm/1/note) identifies the MIDI channel. Since, as I said before, OSCulator cannot fetch parameters from the address pattern, I had to duplicate the settings for each channel. Here is what I came up with for my 4 channel setup (the settings file is included at the bottom of this post) :
However, I wasn’t done yet. By default, OSCulator is expecting parameter values to be between 0 and 1. Traditionnaly MIDI values are between 0 and 127. Therefore, you have to map the values to something usable by the software. To do that, flip to the Scalings page (Command-F) and change the input maximum to 127 for the note and the velocity :
One last thing you need to do, is go to the Parameters I/O Settings (Command-Option-P) and set the Lower Pitch to 0 and the Upper Pitch to 127. It is also adviseable to tick off the “Emulate Pitch Bend Wheel” checkbox :
There you have it. A nice OSC-to-MIDI bridge that you can use in all sorts of weird setups just like mine. This all seems pretty straightforward but when you don’t know where to start it can take a loooong time getting there. I should mention that I used version 2.11.0-beta2 which, I believe is not officially available yet. Keep that in mind. Your mileage may vary.
Hope this helps !