View Issue Details
|0007840: Stretching MIDI regions wrongly handles time offsets
|I encountered two (maybe unrelated) issues when using the time-stretch tool on MIDI regions.
Firstly, when stretching a MIDI region that is not placed at the start of the timeline it seems the region is expanded by the equivalent of the offset at which the region is placed. I.e. having a MIDI region at position t=1, lasting until t=3, using the stretch tool to stretch its ending from t=3 to t=4 will (more or less correctly, see below) stretch its contents to the duration t=1 to t=4, but will afterwards expand the region up to t=5.
The second issue concerns cut MIDI regions. When cutting a MIDI region in two pieces, the first part will behave correctly when stretching (except for the expanding bit above, if it is not at the start of the timeline). The second part of the MIDI region however, when stretched, will not only stretch the cut content to the target length, but it will stretch the original content, from the original start point of the data, up to the cut region's end and fit it into the target time length.
|Midi, MIDI region
Regarding the first part, this is likely fixed in 6.0-pre0-2723 https://github.com/Ardour/ardour/commit/eca27d8218 -- can you test this?
As for the latter, that's likely a follow-up issue to to linked regions:
When you split a region the two regions are still linked. Split is identical to copying the region and then trimming start/end. The use the same underlying source (MIDI file).
After a split, you can trim-drag/extend the 2nd region backward, or the first region forward to reveal the content from before the split.
Editing the content of one of these regions modifies the shared source. Usually handy for patterns
You can use (context or global-menu) Region > MIDI > Unlink from other copies. or disable it globally in Session > Properties > MIsc > MIDI Options
Yes, thanks, that seems to have fixed both issues. However, now I'm encountering a third, that doesn't seem to have been in ardour 5.12, however it does already occur before your fix. (Specifically I'm testing 5e4d641488). Now I'm seeing randomly, incorrectly resized MIDI notes when stretching. I've included two screenshots, one before the stretching operation, one after. I don't know how to debug this more closely, but if you have any ideas, let me know.
Apart from that (even though this probably doesn't matter anymore, because the second point seems to be fixed, too), I didn't really understand your point about unlinking the copies, because I could stretch one of the two cut regions without affecting the other. So I guess either one of these steps (stretching, cutting) seems to implicitly unlink copies, or you are storing stretching-data inside the data-slice views representing the MIDI regions.
> So I guess either one of these steps (stretching, cutting) seems to implicitly unlink copies
Stretch creates a new source and region.
|Tag Attached: Midi
|Tag Attached: MIDI region
|new => feedback
|Note Added: 0020807
|File Added: after.jpg
|File Added: before.jpg
|Note Added: 0020809
|feedback => assigned
|Note Added: 0020810