The-Modular-Mind / oscelot

OSC Mapping module for VCV Rack
GNU General Public License v3.0
20 stars 1 forks source link

Feature Request: Allow client to save a string in the OSCelot preset state #10

Open rjsmith opened 1 year ago

rjsmith commented 1 year ago

TLDR; This capability would allow stateless OSC clients to store arbitrary state in the server (OSCelot) for future retrieval.

It would be super cool if the OSC client could send a message to OSCelot like/oscelot/store that has a "clientState" string argument. OSCelot would then store the clientState string in its current in-memory preset state. So then if I saved the VCVRack OSCelot preset, it would also store that clientState string in the saved preset. And it would then be loaded into OSCelot when that preset was loaded again.

Then need a way for the OSC client to ask OSCelot to send the clientState string. Maybe a pair of request/response message exchanged between the OSC client and OSCelot ? This would only be needed when the OSCelot preset was changed.

For my TouchOSC patch I am designing, the user could decide what configuration of controls they wanted to have on each of the 4 tabs on the patch, PER MODULE! That info could be saved in a JSON structure, stringified and then retrieved in the clientState string as described above.

When the user switches modules, the TouchOSC script could ensure it sets up the right set of visible controls before it gets the /oscelot/module/new request. So the MixMaster module might have a classic mixer control setup, SEQ3 might have 3 rows of 8 knobs, etc why not have specific layouts that mirror the actual layout of specific favourite modules ? Not sure if there is any limit to that.

I haven't figured out how to actually do that last part yet in TouchOSC, but should be possible (hidden nested tabbed pages ?)

Hope this makes some kind of sense. I think this could really open up some further possibilities for dynamic OSC control of complex VCVRack patches.

The-Modular-Mind commented 1 year ago

You mean you want to save/recall an arbitrary string in the oscelot preset right? I could do it I guess.

The second idea I've done something similar for ORAC, using openOSC, basically the controls are populated based on the osc received. The problem with that in VCV is that the params have no notion of slider/knob/button etc built into it, so I can't send a type of control back. (Not sure if this has changed in v2)

rjsmith commented 1 year ago

Hi, yes exactly.

In my idea described above, my TouchOSC patch would save / retrieve a string containing a serliased mapping of VCVRack modules to an internal layout config.

So then when it gets a /oscelot/module/new message from OSCelot it would:

  1. Change TouchOSC control layout tabs based on the identity of the new module. If there is no saved module-specific config, it would apply a default config.
  2. Process the subsequent snapshot controller and info messages from OSCelot, setting up the initial state of the TouchOSC controls on the re-configured tabs.