Using the mod-ui API for setting effect parameters

Hi Mod Devices team,

being new here, first I would like to send out big thanks for this great product!

So far I am playing around with running mod-host and mod-ui on my Raspberry PI. In order to be able to change some settings quickly, I was trying to use the API provided through https://github.com/moddevices/mod-ui/blob/master/mod/webserver.py. However I could not find much documentation and few examples, so it is mostly try and error and reading the code to get something working.

What I e.g. have working:
Via curl -F 'bundlepath=/var/modep/pedalboards/MyOne.pedalboard' http://192.168.86.46/pedalboard/load_bundle/ I can load an existing pedalboard.

Via curl http://192.168.86.46/snapshot/load?id=1 I can load a specific snapshot of a pedalboard.

Via curl http://192.168.86.46/pedalboard/current I get the currently loaded pedalboard

Via curl http://192.168.86.46/pedalboard/info/?bundlepath=/var/modep/pedalboards/MyOne.pedalboard I can get info about a specific pedalboard, like the instance name of an effect/plugin.

What I did not get working:

  1. While I can get info about a specific pedalboard via http://192.168.86.46/pedalboard/info, how can I read the state of the current pedalboard, which might have unsaved changes?

  2. How can I set the parameter of an effect/plugin within the loaded pedalboard?
    I looked at the implementation for /effect/parameter/set/? here: https://github.com/moddevices/mod-ui/blob/master/mod/webserver.py#L1020. Seems like it is reading the body of the sent request and splits it into symbol, instance, portsymbol, value where later only instance, portsymbol, value are used.
    Thus I tried e.g. curl -X POST http://192.168.86.46/effect/parameter/set/? -H "Content-Type: application/json" -d 'unused/Gain/Gain/0.5' for a pedalboard with this content (cut after the Gain plugin):

{
   "title":"MyOne",
   "width":1960,
   "height":3220,
   "midi_separated_mode":false,
   "plugins":[
      {
         "valid":true,
         "bypassed":false,
         "instance":"Gain",
         "uri":"http://moddevices.com/plugins/mod-devel/Gain",
         "bypassCC":{
            "channel":-1,
            "control":0,
            "hasRanges":false,
            "minimum":0.0,
            "maximum":1.0
         },
         "x":36.0,
         "y":20.0,
         "ports":[
            {
               "valid":true,
               "symbol":"Gain",
               "value":0.0,
               "midiCC":{
                  "channel":-1,
                  "control":0,
                  "hasRanges":false,
                  "minimum":0.0,
                  "maximum":1.0
               }
            }
         ],
         "preset":""
      },
...

Any help is very much appreciated!
Cheers,
Thomas

1 Like

this is completely unsupported to try to do things separately, we dont keep the API stable enough that others can rely on it, for now it is still tied to the webgui.
some of the things you are trying to do happen over a websocket, not possible with a simple curl.

2 Likes