I just noticed that renoise.song().tracks[].devices[].parameters[] array does not contain “Linked instrument” parameter for a MidiCcDevice instance.
Is there any specific reason for this lack? I understand that this parameter cannot be changed with a pattern command because of the 0…F range limitation, but why should this prevent scripting from accessing it?
renoise.DeviceParameter is part of the generic interface to a DSP device in Renoise. Basically it’s what Renoise offers automation for, what you see in Renoises UI as slider in a device and what’s offered in the automation view.
But DSP Devices are not just this, they also have non automateable data, or data which can not be easily wrapped into such a “single value” interface. Like for example the LFO Device’s envelope.
For the MidiCcDevice, the reason that the Linked instrument is not a device parameter is that it can not be automated. For the other parameter in the CC device we excluded them because we didn’t wanted to create more than 15 parameters to keep all of them automatable in the pattern.
In order to allow access to all those parameter in Lua, we’d have to publish specialized interfaces for each single device via the Lua API. This of course is possible, but simply quite a lot of work with all the devices we have. We should do so at some point, starting the all meta devices first, cause those are the devices which are most interesting to script, aren’t they?
You can’t. Only notifiers in views do right now pass the value in the notifier function. Would be nice if any observable would, but due to some technical internal problem we could not offer this so far…
This indeed is not nice, but its no show stopper. There are many workarounds for this.
For example local function do memorize all their upvalues:
local parameter = someRenoiseDeviceParameter
parameter.value_observable:add_notifier(function()
local new_value = parameter.value
end)
add_notifier also allows passing a context that is passed to the notifier as first argument
function parameter_changed(parameter)
local new_value = parameter.value
end
-- passed "context" can be any table or class object
some_parameter.value_observable:add_notifier(parameter_changed, some_parameter)