Is it possible to add an ADSR effect to an instrument, via the Tools API? Additionally, if it is possible to add the effect, is it possible to adjust its settings, such as attack time?
I’ve been poking around in in the Renoise.Song.API documentation but have either missed it or am not understanding something fundamental.
OK, so I’ve spent time trying to understand this… but still no joy. Can someone provide an example of how to add an SampleAhdrsModulationDevice to the current sample?
local function insert_modulation_device(idx,target_idx,device_idx)
local mod_set=renoise.song().selected_sample_modulation_set
if (mod_set) then
oprint(mod_set.available_devices) --Look at this!
local device_path=mod_set.available_devices[idx]
mod_set:insert_device_at(device_path,target_idx,device_idx)
end
insert_modulation_device(4,1,1) -- 4--> AHDSR
I have written the code directly here, but it should work.
Note: for years, the API has not had the option of being able to select the target (Vol Pan Ptc …). But at least you can assign the modulation you want on the target through the value target_idx.
In short, you will be able to insert the modulation device inside a concrete target, but later you will not be able to select the target from the API. Hopefully @taktik fixes it! I am also using these things and it is very annoying…
Related documentation (R3.3.2)
-- Insert a new device at the given position. "device_path" must be one of
-- renoise.song().instruments[].sample_modulation_sets[].available_devices.
renoise.song().instruments[].sample_modulation_sets[]:insert_device_at(device_path, index)
-> [returns new renoise.SampleModulationDevice object]
The documentation has not been corrected yet! Maybe you had problems here?
The correct code is this: