This is a somewhat fragile solution to ensure that
processor reset happens in the same cycle in which
the actual data arrives at the start of the cycle.
LUA EditorAction script to chronologically reverse MIDI notes
of selected MIDI regions, alongside MIDI region positions.
* The positions of the MIDI regions are reversed as well, meaning regions
at the end appear at the beginning and so on.
* Individual notes are reversed so the ending of a note corresponds to its
beginning. Thus notes should be quantized for this effect to yield good
results.
* Note that only MIDI notes are reversed. Other MIDI events such as CC or
SYSEX are left unchanged.
Variables by these names are only used from the local wscript and when
running "waf configure", which already for other reasons only can run at
the top-level.
These variables are thus not mandatory and not used.
This allows to move or copy whole sections of the timline (everything
you hear) to a differnt position on the timeline.
NB. Markers and tempo-map are not yet moved, and interpolated MIDI
events are lost.
Tempo Map updates can change a region's position/length, in which case
region-automation may follow the region, and DiskReader:: playlist_ranges_moved
will save additional undo information.
These MementoCommand(s) need to be included in the undo operation.
Import via Drag/Drop previously worked by selecting a track,
and then importing to the selected track.
This approach fails when the selected track is in a track-group,
and selecting the track also selects other tracks of different type.
Now the track to drop onto is passed directly passed through to
::finish_bringing_in_material as existing_track.
This is really just an example synth (sine wave + fixed
basic ASR envelope).
Note: existing sessions using the synth are not affected, the
script is saved with the session.