Changing ParMode within onSetupParameters method of script CHOP does not work properly

i’ve written a little script to help me quickly create bindings for parameters that also accept input from a MIDI device. i’m trying to build an “auto-bind” mode which will take the names of the incoming channels and automatically bind the created parameters to the corresponding parameters in the parent COMP. i’ve got everything working as expected except parameter mode switching for the created parameters.

i’ve set my script to print the current parameter mode for each parameter in the script CHOP, then change that parameter mode to BIND, then print the parameter mode again. the print commands reflect the mode change but the parameters do not actually change modes. sometimes one or two of the parameters will change modes as expected but it’s very inconsistent. error is reproducible with the attached .tox - just click “setup” and the internal script CHOP’s parameters should be generated, then bound to the test params in the MOS COMP.

MOS.tox (2.4 KB)

build is 64-Bit 2022.28040 running on Windows 10.

Hey @saiteron, welcome to the forum.

I saw you’re creating new parameters and then set their binding all within the same frame. I had a hunch this could be the cause of the issue you are seeing, so I made a variation on your file where the binding is done one frame later, and this seems to work without problems.

So I can imagine creating a new par needs some internal housekeeping which is perhaps always done at the end of each frame? But I’m just guessing here…

I’ll leave it to Derivative to answer if this issue is indeed a bug or expected behavior.

MOS-delayOneFrame.1.toe (5.3 KB)

1 Like

amazing, thanks! i figured it was something like that - trying to do too much all at once. i’m brand new to Python so this little script is already pushing the limits of what i know. appreciate the quick fix and the opportunity to learn!