Suppose that I have a simple script that processes midi, in this case, a transpose function that has a single parameter which I define in onLoadIntoSlot as follows:
function onLoadIntoSlot() defineParameter("Transpose", "Transpose Amount", 12, -96, 96, 1, onTransposeChange) end
Now, when I move this around the program tree, e.g., above or below another copy of the same script. The value of the parameter is reset as the move is viewed as a new “load into slot.” The built in midi tools, of course, don’t have this issue, if you change a parameter and them move them around, the parameter remains as set.
So, is there some way to preserve state here such that, it defaults to 12 on load, but will remain unchanged when moved around? Are there best practices documented somewhere that I missed? I know that the state is correct immediately on call to onRemoveFromSlot so that seems like the place to preserve the state, but I can’t help but feel like I’m missing something fundamental here.
It would be great to see a good example of a full midi processor written in HalionScript from Steinberg.
BTW: I’m new to this forum, not new to Cubase, new to Halion, not new to programming.