preArgs question

Are preArgs only relevant in midi situations? If not, would you be able to help me please understand a scenario when one might use preArgs?

Hi, i don't use it for midi, i send midi in a custom module. My scenario is to use a variable here, to have a switch. When you have e.g. OSC listeners you can easily prepend the prearg from a custom module. Also it is nice on clones, you overwrite just the preargs, and control various parts of the widget. Hope this helps...

Osc messages are made of an address (starting with a slash /) and zero or more arguments. Examples:

  • /example_daw/play would start playback -> no argument
  • /example_daw/master/volume <value> -> only one argument, for example a fader with no preArgs
  • /example_daw/track/volume <track_number> <value> -> here with a fader you'd need preArgs to define the track number and have the widget's value at the correct position in the message.

@abstrus That sounds really interesting. Would you mind explaining a little more, or perhaps share a session and custom module to show how you use it? Just really want to learn this thing properly.

@jean-emmanuel So preArgs only come into it when you need more than one argument? eg with midi /control for example needing a cc number and cc value. Or your example with a fader needing a track number and a value? So preArgs are like moreArgs or extraArgs (sorry, just trying to get my head around it all).

If you sent /track/1/volume you would not need preArgs, correct?

Are there any other uses for preArgs? (I haven't quite understood @abstrus use case yet)

Hi @GeneralMidi you can take a look here:

This uses an external amplifier.

What i tried to explain:

i use a modal (with a prearg as variable), in this modal you request by midi which fx should show up and which value they have.
one FX slot is refered to as stomp, a lot of them are treated equally.
One is fully built the rest is cloned, the clone just needs a pre args value.

Depending on the stomp and the fx requested by midi i show up knobs and values(by just pressing a button), adjust the number of steps and the value range, all done with OSC receive.
The communication is working two way, means changing values in the gui or on the hardware device update each other.

Hope this helps a bit otherwise i try it to explain further... (please keep in mind that this needs cleanup, and improvements where i can find them)

Yes, it's called preArgs because these extra arguments are prepended to the widget's value.

Hi @abstrus . I can't run your session file.

Errors
TypeError: Cannot read property 'split' of undefined
    at loadJSON (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\src\server\custom-module.js:28:1)
    at Object.init (C:\Users\Luke\Desktop\KEKO-Kemper-Control-main\KEKO-Kemper-Control-main\modules\kemper.js:1774:26)
    at CustomModule.init (C:\Users\Luke\Desktop\KEKO-Kemper-Control-main\KEKO-Kemper-Control-main\main.js:10:6)
    at OscServer.init (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\src\server\osc\index.js:200:1)
    at Object.277.../custom-module (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\src\server\osc\index.js:210:1)
    at o (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\node_modules\browser-pack\_prelude.js:1:1)
    at C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\node_modules\browser-pack\_prelude.js:1:1
    at Object. (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\src\server\server.js:210:1)
    at Object. (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\open-stage-control-server.js:75706:4)
    at Object.281../auth (C:\Users\Luke\Desktop\open-stage-control-1.9.0-win32-x64\open-stage-control-1.9.0-win32-x64\resources\app\server\open-stage-control-server.js:75706:17)
(DEBUG, MIDI) device "oscServer" created
(DEBUG, MIDI) device "oscServer" connected to input port 0 (oscSERVER 0)
(DEBUG, MIDI) device "oscServer" connected to output port 1 (oscSERVER 1)
(INFO) Server started, app available at 
    http://192.168.10.48:8080
    http://127.0.0.1:8080```

Hi, yes that is because of v 1.9. in my current version that is allready fixed. The json has changed. If you try it with 1.8.15 it should work...

It looks like a custom module error, but the error message you posted is not complete @GeneralMidi. @abstrus v1.8 sessions can be loaded in v1.9, it's the other way around that doesn't work.

@jean-emmanuel Error message updated.

Also, loading Abstrus's session with no custom module loaded hangs the server when closing the session view window. Have to force close the server. Stop (F6) does not stop the server.

TypeError: Cannot read property 'split' of undefined
at loadJSON (custom-module.js:28:1)

Read custom-module.js at line 28, my guess is that it's reading some server option you didn't set (probably send)

hang

I confirm the bug, it's not related to this session, will fix for v1.9.1.

I had a problem with loadjson in the custom module, the fix is not in git, because other things are in the new release too...

@abstrus I think I'll just wait until you get it sorted. Don't really want to download an older version. Too much to explore in the current version. I'll be busy for a while. No rush. Also, do you have a video of you using your set up? Would be good to see in context.

@GeneralMidi of course

there is a video (with the old gui, etc.) but you get the picture...

Feedback is always welcome!

Hi @abstrus . I've been trying to get your session to load but it just won't. I've tried with 1.8.15, 1.9.2 and 1.9.3.

Any ideas?

Same errors as here preArgs question - #8 by GeneralMidi

Hi, i tried the newest Version on my Github site with 1.9.3.
What you here see is the result of a not readable part of the json. (The structure of the json changes when you export just one tab like in my case -> if the VIEW value could not be read, all properties of widgets geometry default to auto / 0). -> to avoid this i built in a switch, so it does not matter if it is one tab, or more or exported, etc.

Have you downloaded the newest versiom from my github site?

Have you used the state file(you have to adapt the paths, and the midi settings, in and output)

Yes, I have the newest version. I did not try the state file. I will tomorrow. Thanks you for a fast reply :slight_smile: