Api: Inconsistencies in the documentation

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…

Okay, well, the notation is correct, so the description then should match it.

Of the following functions, either the description is not correct or the function is not correct (renoise.SongAPI.txt line 480 and further):

renoise.song().tracks.prefx_volume
→ [renoise.DeviceParameter object]
renoise.song().tracks.prefx_panning
→ [renoise.DeviceParameter object]
renoise.song().tracks.prefx_width
→ [renoise.DeviceParameter object]

renoise.song().tracks.postfx_volume
→ [renoise.DeviceParameter object]
renoise.song().tracks.postfx_panning
→ [renoise.DeviceParameter object]

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.

Those are objects and you can’t assign a value like that, try this:

renoise.song().tracks[1].postfx_volume.value = 1

renoise.song().tracks[1].postfx_volume.value = renoise.song().tracks[1].postfx_volume.value_default

Done the same mistake during the alphas.

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.

@taktik, this issue will be reviewed to remove the ()?

renoise.Midi.devices_changed_observable():add_notifier (still in use)

renoise.Midi.devices_changed_observable:add_notifier (what i expected)

(the same to has_notifier, remove_notifier)

This is a little confusing…

This is indeed is still confusing, but this would break backwards compatibility, so I won’t change this in a minor API update.

Ah ok! Maybe an explicit explanation in the documentation is enough.

I even checked this in Copilot, and it returned it without parentheses :sweat_smile: