View Issue Details

IDCategoryLast Update
0007768features2019-06-22 02:10
ReporterjeffbrownAssigned To 
ReproducibilityN/A 
Status newResolutionopen 
PlatformSome Other LinuxOSSome Other LinuxOS Versionunknown
Product Version5.12 
Fixed in Version 
Summary0007768: MIDI warp: linearly stretch the timing of MIDI events in a region
Description# Linear MIDI warping

In Ableton Live you can "warp" audio -- you might take a 2 second clip of sound, and stretch it so that what used to be the first half of the clip occupies the first 90%, and what used to be the second half occupies the remaining 10%.

Doing that with audio seems hard, and I'm not asking for it. But similarly warping MIDI is dead simple, at least mathematically (see below). And surprisingly, Ableton do not offer it.

This feature would let the user add "warp marks" to a point in the MIDI timeline, and then drag them around. Dragging a warp mark causes a linear stretching of the events around it, while keeping the other warp marks fixed.


## One reason you might want to do this

Suppose you record without a metronome, and your left hand always slams down a particular chord X at the start of the beat. If you stuck a warp mark at the start of each X, you could then drag those marks around to change the tempo of what you played locally, while preserving the rhythm.

Among other possibilities, this lets you add a click track after you've recorded without one. That's valuable because many players find it easier to be more creative without a click track.


## The math

Suppose the user has drawn three warp marks, at times `a`, `b0` and `c`, where `a < b0 < c`. Suppose the user then drags the middle marker from the old time `b0` to the new time `b1`.

No MIDI events before `a` or after `c` will be affected by the move. (For warp purposes, the start and end of a note are treated as two separate MIDI events.)

Consider a MIDI event which, before `b0` is warped to `b1`, occurs at time `t0`, where `a < t0 < b0`. After warping, this event will occur at time `t1`, where
```
t1 = (t0 - a) * (b1 - a) / (b0 - a) + a
```

Similarly, if `b0 < t0 < c`, then after `b0` is warped to `b1`, an event which used to occur at time `t0` will now occur at time `t1`, where
```
t1 = c - (c - t0) * (c - b1) / (c - b0)
```

Those formulas work regardless of whether the middle marker is dragged forward or backward.
Additional InformationIf my description is not clear, I could try making some animations and upload them to Youtube.
TagsMidi

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-06-22 02:10 jeffbrown New Issue
2019-06-22 02:10 jeffbrown Tag Attached: Midi