Most notifiers are defined as:
renoise.some_object_observable:add_notifier(function_name)
The midi devices changed observable notifier must be added like this:
renoise.Midi.devices_changed_observable():add_notifier(function_name)
Took me a while before i got the picture (by experimenting with oprint in the terminal)
Is there a specific reason why for the midi devices, this notifier setting method deviates?
renoise.song().transport.bpm_observable -> property of an object
renoise.Midi.devices_changed_observable() -> global function (well, function in a namespace)
Yay. devices_changed_observable “could” also be a global variable.
But this actually has nothing to do with observables. renoise.song() also is a function and not a global variable. As long as its documented correctly this IMHO is just fine - either way…
renoise.song().tracks[1].postfx_volume = 1
*** property ‘postfx_volume’ is read only
*** stack traceback:
*** [C]: in function ‘__newindex’
*** [string “do…”]:22: in function <[string “do…”]:11>
*** [string “renoise.song().tracks[1].postfx_volume = 1”]:1: in main chunk
renoise.song().tracks[1].postfx_panning = 1
*** property ‘postfx_panning’ is read only
*** stack traceback:
*** [C]: in function ‘__newindex’
*** [string “do…”]:22: in function <[string “do…”]:11>
*** [string “renoise.song().tracks[1].postfx_panning = 1”]:1: in main chunk
renoise.song().tracks[1].prefx_panning = 1
*** property ‘prefx_panning’ is read only
*** stack traceback:
*** [C]: in function ‘__newindex’
*** [string “do…”]:22: in function <[string “do…”]:11>
*** [string “renoise.song().tracks[1].prefx_panning = 1”]:1: in main chunk
Besides the reason that the read-only description lacks, I would not expect those to be read-only in general.
oprint is our best friend… perhaps performing a default oprint action if some error appears when calling such object?
“is read-only” does not give a user the idea they have to look a bit deeper.