local function insert_modulation_device(idx,target_idx,device_idx)
if (mod_set) then
oprint(mod_set.available_devices) --Look at this!
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
-> [returns new renoise.SampleModulationDevice object]
The documentation has not been corrected yet! Maybe you had problems here?
The correct code is this:
target_index corresponds to the index of: Vol, Pan, Ptc, Cut, Res or Drv