Hi,
I’m facing some Undo/Redo difficulties when setting DeviceParameter values and adding points to an envelope.
Whenever I receive a fader value change from my external FaderPort controller I update a DeviceParameter.value e.g.
renoise.song().selected_track.prefx_volume.value = myvalue
That works greatly and the Renoise mixer faders move accordingly to the received updates. Only Problem: it seems that no undo/redo data is beeing written. Interestingly that problem doesn’t occure when using Duplex virtual UI faders or moving the Renoise faders directly. Couldn’t find out why.
Also I don’t understand the behaviour of the following code.
-- precondition: a new song has been created and no sliders were moved, the prefx vol slider is set to Renoise 0 dB
function __init()
renoise.song().selected_track.prefx_volume.value = 1.2 -- set to something new
renoise.song().selected_track.prefx_volume.value = 0.0 -- set to -INF
end
When calling __init() the sliders are correctly moved to -INF. Now, when pressing undo the value is astonishingly reset to 0 dB and not to 1.2 as expected. The value change to 1.2 seems to not have been recorded into undo/redo queue.
Is this maybe a wanted performance related behaviour ? I’m aware that it doesn’t make sense to add undo data for every
value change while fader beeing moved, but it seems there is no explicit function to force writing of undo-data like e.g.
song().instruments[].samples[].sample_buffer.finalize_sample_data_changes()
``` provides. Said that Renoise mixer faders seem to write undo-data whenever fader has been moved and mouse-button is released, right ?
Since my faderport provides a fader-is-touched state I'd like to call a finalize_devpara_value_change() or something
whenever the touched-state changes to "untouched". [b]Is there another solution I've overseen, or maybe could such a function be added to song API ?[/b]
I also tried to use the following function, but it didn't help. BTW: what is it actually good for ?
```lua
renoise.song().tracks[].devices[].parameters[].record_value(value)
Moreover, I experience the same problems with:
renoise.song().patterns[].tracks[].automation[]:add_point_at(time, value)
I can’t undo/redo multiple added or changed point values. It’s the same principle here as described above.