I still have problems with notifiers. If I add a notifier like in the code below things will work as expected, but on startup Renoise will always give an error message(but not crash since b7). Am I doing it wrong? Attached tool demonstrates the problem. Install and restart Renoise.
On startup, while your tool is loaded by Renoise, there is no song yet. Also songs will be (re)created when loading new songs in Renoise, or when hitting “new Song” in Renoise. So you have to (re)attach notifiers for each new song that gets instantiated. Aka: the value of renoise.song() changes with every new song that you do load/create within Renoise.
In most cases attaching to a song is only needed when your tool actually does something with the song. Like its showing a GUI, does some kind of processing on the currently running song and so on. So you maybe want to add notifiers only then, and not all the time in the background, while your tool does nothing beside sitting in the background and waiting for a job to be done…
Rough overview about a tools lifetime:
[S] tool startup
[R] tool running
[F] tool finalized
* [S] Renoise starts
* [S] tool opened, main body of tool is executed
* [S] initial song loaded/created (app().song valid the first time)
* [R] ** some functions (keybindings, menu entries, timers or app() notifiers) of your tools may be called (user invokes your tool).
* [R] ** ...[new songs are maybe loaded/created] (app().song changes)
* [F] tool is closed
* [F] Renoise shuts down
add/remove notifiers to songs in [R] only. Add/remove notifiers to the app in [S]/[F] or [R].
If you let us know what exactly your tool does, and you are still unsure how this works, we could give you a few more “practical” tips.
I have to ask one more question. I had a look at this example and saw that it is possible to send data to a notifier on creation. That works fine. But when I want to remove a notifier I first want to check that it is there. If I do this:
>>> function notifier(indata, notification) \
I’m surprised that the result is false. How can I check if a notifier is present?