TouchOSC + Modep - Toggles and presets

Thanks for the reply @Giedrius. I’ve moved on a little with this now using a slightly different approach. I’ve resorted to using the MPK CC controls to toggle the instruments which isn’t a big deal. I’ve also managed to select presets in AMSynth using touch buttons through TouchOSC.

The way I’ve done this is to have a python script run at startup which is based on the ‘MIDI Command Server’ from here -> MIDI Command Server.

I’ve got it listening messages on an unused CC channel and then takes the control value to perform a lookup into an array of preset mappings and uses the message value (0 or 127) to provide the on/off value. This info is then used to construct a URL GET request that I send to the patchbox server - as the MODEP interface does to change the preset.

# TouchOSC CH16 - on/off for AMSynth Instrument preset GET requests
if msg.channel == 15 and msg.value == 127 and lastPreset != msg.control:
PARAMS = {'uri':'http://code.google.com/p/amsynth/amsynth#' + presets[msg.control]} 
URL = 'http://patchbox.local/effect/preset/load/graph/amsynth_1'
r = session.get(url = URL, params = PARAMS)

This seems to work quite nicely.

I also tried to use a similar mechansim for the instrument toggling but this uses an AJAX POST to patchbox.local/effect/parameter/set/
… but that doesn’t seem to work :frowning:

FluidDrums kit selection uses the same POST mechanism too and that doesn’t work either although I get ‘true’ response from it but the kit doesn’t change. Even going throught the browser Dev tools, replaying the XmlHTTPRequest doesn’t work - so I think I’m missing something for these posts.

I’m going to take a look at the liblilv library you mentioned to see if that will help.

Thanks

1 Like