[Solved] Xrnx Tool Completely Freezes Renoise Upon Vst Loading

the plugin gets correctly instantiated (accoring to log.txt and status label) but then Renoise just freezes forever so I really cannot understand what the problem is. I can only say that disabling the script solves the problem

Win7 64bit.

Same thing happens when trying to load a sample or xrni, anything that changes an instrument’s name. Renaming and instrument without loading also freezes.

You are listening to instrument name changes in your tool, but the notifier itself changes the instruments name as well - you’re trapping yourself in the notifier by readding the notifier again and again. Unfortunately Renoise can at the moment not detect such script freezes, that’s why you get no “Terminate Script?” message from Renoise.

I don’t fully understand what you are doing in the tool, so I can give you the advise to check this behavior in detail.
If you need more help, let me know and I’ll have a deeper look into this.

thanks for your help. I could swear I tried renaming the instrument, but probably I only tried to rename samples. I will look into this as soon as possible

I have narrowed the problem to this part:

  
if not instrument.name_observable:has_notifier(look_for_synths_instrument_renaming) then  
 instrument.name_observable:add_notifier(look_for_synths_instrument_renaming)  
end  

yes, the notifier “look_for_synths_instrument_renaming” calls that part of the code again, but I see no reason for which add_notifier(look_for_synths_instrument_renaming) should immediately call look_for_synths_instrument_renaming() which calls that code and generates the loop.

also, the “if” statement should avoid the loop on the first place, after the first call.

if you try commenting the line with the “add_notifier()” statement I have quoted above, the loop will not be generated. to remove any other doubt, you can also comment out all the next “if” block, which actually performs instrument renaming:

if instrument.name == "Synth" and int_synths < NUMBER_OF_SYNTHS - 1 then  

Then something must remove the notifier right before the check is done. There are various places where it does so in the script. Hard for me to follow the control flow. Maybe you have an idea.

Basically, the problem is:

  
function my_notifier()  
 -- [...] stuff  
 if (has notifier(my_notifier)) then  
 remove_notifier(my_notifier)  
 end  
  
 -- [...] stuff  
 if (not has notifier(my_notifier)) then  
 add_notifier(my_notifier)  
 end  
  
 -- once called from Renoise, this will be called again,   
 -- and again, cause you are adding yourself again and again   
 -- to the notifier chain  
end  
  

ok, I have understood the wrong idea behind my way of doing this. this solves the problem, thanks