# \[Solved\] Xrnx Tool Completely Freezes Renoise Upon Vst Loading

**URL:** <https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728>\
**Category:** Renoise Tool Development\
**Created:** [December 15, 2010, 8:56pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728 "2010-12-15T20:56:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [December 15, 2010, 8:56pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728/1 "2010-12-15T20:56:58Z")

</div>

- install [this tool](http://www.renoise.com/board/index.php?app=core&module=attach&section=attach&attach_id=1484)

- load any VST

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.

---

<div class="post-metadata">

**Author:** ![taktik](https://forum.renoise.com/user_avatar/forum.renoise.com/taktik/32/3823_2.png) [@taktik](https://forum.renoise.com/u/taktik)\
**Post date:** [December 17, 2010, 1:17pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728/2 "2010-12-17T13:17:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [December 17, 2010, 2:50pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728/3 "2010-12-17T14:50:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [December 17, 2010, 6:29pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728/4 "2010-12-17T18:29:01Z")

</div>

I have narrowed the problem to this part:

```php
  
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:

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

```

---

<div class="post-metadata">

**Author:** ![taktik](https://forum.renoise.com/user_avatar/forum.renoise.com/taktik/32/3823_2.png) [@taktik](https://forum.renoise.com/u/taktik)\
**Post date:** [December 17, 2010, 6:54pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728/5 "2010-12-17T18:54:25Z")

</div>

> [@It-Alien](#):
>
> I have narrowed the problem to this part:
> 
> ```php
>   
> if not instrument.name_observable:has_notifier(look_for_synths_instrument_renaming) then  
> instrument.name_observable:add_notifier(look_for_synths_instrument_renaming)  
> end  
> 
> ```

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:

```auto
  
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  
  

```

---

<div class="post-metadata">

**Author:** ![It-Alien](https://forum.renoise.com/user_avatar/forum.renoise.com/it-alien/32/41_2.png) [@It-Alien](https://forum.renoise.com/u/It-Alien)\
**Post date:** [December 17, 2010, 7:48pm UTC](https://forum.renoise.com/t/solved-xrnx-tool-completely-freezes-renoise-upon-vst-loading/30728/6 "2010-12-17T19:48:36Z")

</div>

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