Thanks! I’ll go through this and see what I can spot…
Hey Dan! Just wanted to see if there was anything else I could help with here, or if there any interesting findings. No rush as I know you may be busy with the AIO expander release.
I just went back to building it again… For some reason I had to add more files into the CMakeLists to get it to compile, not sure if I have an older version… but it’s running now.
And it’s doing the thing where it’s just playing well without overloading… hmm…
Ok, so I found that loading and unloading the patch makes it start or stop working. And then…
Aha! I think I found it. Look here:
There’s a fprintf()
in the audio loop. It probably was accidentally left in there from debugging, since it just prints and doesn’t do anything to fix or abort.
Due to the strange nature of floats, we’re actually getting a negative zero (-0) which satisfies -0 < 0
, so it fires the printf() even though it seems to be working fine.
I commented that out and the filter module is working consistently now.
You probably want to search for printf and fprintf, and check each one if it might get called during audio processing. I did a quick search and there are a lot of calls to those functions, but many/most/all are within some #if 0
block or commented out (which I assume is what the authors meant to do with the one I just found), or otherwise in a unit test file. But worth going through and making sure there aren’t any more.
Really fascinating. For my own learning, how did you find this? Were you just scanning through the code to find anything out of the ordinary?
edit: Yup commenting that out also fixed it for me!
edit2: Getting underway with a ton more modules! However, seeing some with UIs that I don’t if are supported, like this UI element representing the “Range” for VCV Library - Squinky Labs Booty Shifter
Similarly - all these buttons are like radio buttons, not sure if they’re supported. Would be great to map a knob to it. I am able to change this waveform selection to a knob in the metamodule port, but not sure if there’s anything we can to to preserve VCV rack connectivity
I connected a UART-USB adaptor so I could read the console messages. And I saw endless messages res out of bounds -0.000000
scrolling by. So I searched for that in the source code and bingo!
Hmm… these kind of UI issues take some creativity, going from a mouse-based UI to an encoder UI.
If you can make it a knob and have it work, then you might need a way to translate however the VCV module saves its state, into how MetaModule wants to see the state. So, probably start with looking at how the module saves this parameter value in the dataToJson()
function. When you save a patch with the hub in VCV, it will store the output of this function in the patch file. Then when you load that patch file on the MM, it reads the json from the patch file and feeds it back to dataFromJson()
. So if you need to do any kind of translation, putting it in the << plugin’s dataFromJson()
might be the place to do it.
So it ends up mapping pretty well with a RoundSnappedKnob or whatever the name is.
It would be nice to somehow give visual feedback though as to what mode you are in, besides the position of the encoder.
For example, the Stairway filter has a bunch of different configurations, like 4P Low Pass, 2P Low Pass, 4P High Pass, and so on - you kind of are left guessing and have to just listen to figure out what mode you are in, it is nice to have to have some text to tell you what mode you are in.
I tried a rudimentary addLabel but I don’t think this is supported in MM yet.
Old reply, sorry but you might want to look at the CenteredLabel class in JW Modules. It took a bit of tweaking but we eventually got it working to have text updated in response to a knobs’s value:
To do graphics you’d need to draw them with nvg commands in the widget’s draw() or drawLayer() function, and then it should work.