Not A Fan Of "notifier Feedback Loop Detected"


I am the only only who have issues with the “notifier feedback loop detected”?

I want to be able to change the value in the notifier, I’m not causing a loop, I just change the value once.

For example:

Then I want to set the value back to what it was before the user did the selection

Or do you have another suggestion how to achieve this?


The easiest way to deal with this, I think, is to “raise a flag” just before triggering the event

bypass_notifier = true -- raise the flag  
set_dropdown_value() -- perform some function that will invoke the notifier method  
bypass_notifier = false -- lower the flag  

Then, in the notifier method you can check the flag’s condition

notifier = function(e)  
 if not bypass_notifier then  
 -- add code to handle the event   

I also encountered this while trying to do validation on some user input.

I’d like to see the old and new values passed into the notifier, and have a way to override the value. (perhaps by returning a new value)


I believe that notifier feedback is something which cannot easily be avoided: As long as you are listening for something whose value you modify, you risk getting caught in one of these loops.

IMHO, it’s not something which could / should be solved on the API level - it’s up to us script authors to avoid these endless loops :slight_smile:

That said, I think it’s awesome that the Renoise API has built-in feedback detection - after all, it is quite easy to make such a script by accident.

You may change the value once in the script, but one of the pitfalls here is that the change is causing your object function to also make a change in the pattern, instrument or whatever and if you happen to have an observable attached to that object in Renoise, it would then on its turn fire the observable function which in turn might have a reference to change the value in your GUI object (that you already changed once in your other routine)… and that is how the infinite circle is continuing without you knowing it.
Danoise his suggestion to indeed add a cross-reference parameter check to prevent different routines battling with eachother to change the parameter is the best way to go.


Fans of infinite loops, pcall is the cure:

 id = "popup_patches",  
 notifier = function(new_index)  
 pcall(change_me_already, 5)  
function change_me_already(val)  
 vb.views.popup_patches.value = val