panel.changed() recursion
-
I have a panel I've set up as a slider. In the panel's event.drag callback I do set the value of the panel and then call the
.changed()
function, this applies the value of the panel to the parameter I've linked the panel to. However it is also triggering a recursion and giving me a warningRecursive call to changed() for sliPan2
In the API documentation it says there is recursion protection for the
.changed()
function, so can I just ignore this? -
Actually it uses a stupid timer approach to catch recursion which might give false positives if you call this function with high frequency. The cleaner solution would be a stack based test.
I am currently moving everything script related into a separate thread so while I am at this, maybe I can implement this more robustly. I remember when I implemented the recursion protection there were some weird edge cases which lead me to the timer solution but maybe with the new solution it‘s more straight forward.
-
@christoph-hart This issue is still present in the develop branch. Doesn't seem to cause any harm, just floods the console with warnings.
-
Stack based approach it is.
Since every script code runs on a dedicated thread now, it can be executed synchronously and just needs to be deferred when you call it from a MIDI callback...
-
@christoph-hart Going to build now :)