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.
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.