Module JSON data implementation

Hello,

Finally got my Meta Module yesterday and messed around with it a bit.

I noticed there is something weird going on with module JSON data in patches and I’m guessing dataFromJson() method is not currently implemented?

Really cool module and I bet it was a ton of work so congrats on getting it out the door!

Looked into this more: dataFromJson() method is implemented in the Meta Module VCV module wrapper and it definitely works.

The problem was that in my kocmoc VCV module code it was assumed that dataFromJson() should only read the JSON data into the struct variable and other methods would set and act on the new values, which is what happens in VCV Rack but it doesn’t on Meta Module (because menu items aren’t supported? I don’t know…)

Acting on new values explicitly inside the plugin dataFromJson() method corrected this issue.

1 Like

Hi Janne! First of all, thanks for the kocmoc modules!

So, you’re right, dataFromJson() is called when a module loads, but menus are not supported, so a module needs another way to modify those if it’s to be done from with MetaModule.

MetaModule does support “AltParams” which are hidden parameters that don’t show up on the panel, but are at the bottom of the list of elements when you click on a module. For example, see Marbles (aka Random-Maker), at the bottom of the list of knobs and jacks is “Scale”, where you can choose the scale to quantize to.
This was added manually, BTW, here:

(and the other two places where X_SCALE_PARAM appears in that file), and here:

Marbles is a little different because it’s built-into the firmware, so until I make an API for creating an AltParam, you can’t do this with a plugin. It would be something like the calls to addParam(createParam<WidgetType>(....)) but would be addParam(createAltParam<AltParamType>(...))

Ideally the MetaModule could scan and convert the VCV Menu callbacks and create AltParams from these, but I’m not sure it’s possible without creating a ModuleWidget instance for every module when the patch loads.

My pleasure.

Okay, for now the plugin loads the filter oversampling parameters from the patch JSON data so importing from VCV Rack works correctly.

I can add AltParams when they’re available for the plugin API.

There’s the latest commit for version 2.0.4 with the fixes if you want to update the website or if someone wants to compile it for themselves.

Plugin binary here: