Tuesday, January 29, 2013

Controlling Linux audio plugins using touchOSC for Android

I was thinking to control some of the audio plugins that I have on my linux machine using an Android OEM tablet sending OSC messages to the PC.

My first attempt was to use some of the existing OSC apps that are available on Google Play such as:

1. touchOSC for Android: I was very impressed for nice GUIs included in the app and the responsiveness on the tablet, but I was realized that at the moment (January 2013) there no was a way to create customized layouts and synchronize them easily, such as in touchOSC for iPad/Iphone.
2. Control: very promise app but for some reason I cannot run it smoothly in my tablet, it just goes incredible slow.
3. quickOSC: very promise app also, and some that I was looking for since It permit modify the OSC path!. Unfortunately every time that I selected a button or an slider an "Error sending message" appeared that forbid me to send OSC messages to the host.

Frustrated, I dropped this idea for some while...

Just a few weeks I restarted this idea, searching again on the touchOSC site and I reached the touchOSC editor and one app (OSCPad) that allowed me to load the edited layout. It was very promising but I realized that OSCPad still has some to-do features yet that allowed me to control plugins in a more flexible way.

I found then this handy page that explains some hacks to do on the touchOSC apk to include the modified layout in the apk before it gets installed in Android.

So, at that moment I had a way to create a custom layout, creating custom knobs, sliders and buttons trying to emulate the plugin on the linux machine.

After some tests, I realized that I was able to create a custom layout BUT incredible, the OSC path for that new layout was NOT updated, just sending the one that is included by default in the touchOSC Editor, not the one that I modified in order to match the OSC Path on the host running on the PC.

One note aside for the plugin host:

In my first attempt, I tried to control the plugin just sending direct OSC messages to a DSSI plugin running jack-dssi-host; my intention was to send OSC control messages to the UDP port that is initialized when the plugin is started:

jack-dssi-host /usr/lib/dssi/nekobee.so

jack-dssi-host: OSC URL is:

host: Ready
nekobee_gtk starting (pid 3276)...

In this case the UDP port is 10409.

The first attempts to send OSC messages using 'oscsend', 'oscdump' from liblo and 'dssi_osc_send', 'dssi_osc_update' were satisfactory showing that was possible to modify the parameter sending control messages to the DSSI host.
One thing that I realized is that the plugin GUI was not updated after parameter modification, since the normal operation is the opposite of this, you just control the GUI and send OSC messages to the DSSI plugin engine.

Then, thanks to LAU/LAD lists (Robin Gareus, Michael Noble, among others, thank you very much!), I've found the Cadence/Carla software application that allowed me to host any type of plugin, not only DSSI, but LADSPA, LV2, VST, and of course DSSI, controlling them using a OSC Path customized for every plugin, as indicated in the Carla 'Help' tab:

I just need to translate the OSC messages that I was receiving from the custom layout (but with the default OSC Path) in Android to the Carla OSC commands to control the plugin.

This is where PD comes in action. The main idea was to receive in some port the UDP messages from touchOSC in android, translate them to the Carla nomenclature and send to Carla host using its UDP port.

I must say that I'm not an PD expert so it take me some time to understand how to do that. After some test I was able to understand the OSC functionality in PD and I was able to create this patch:

This patch receive OSC messages in UDP port 9001 from touchOSC, route and translate the messages using routeOSC object and send them to Carla.

The whole idea as a test case was to control Nekobee plugin (TB303 emulator) on Carla using a touchOSC custom layout in android translating the OSC messages in PD.

 Links to files:

touchOSC Layout Editor
touchOSC Layout Encoder
touchOSC Custom Layout to control Nekobee
PD Translator Patch
Nekobee GIT
Cadence GIT

No comments: