Double the speed of a MIDI region

Ardour 8.6 from ardour.org

It seems that I am not able to reliably change the tempo of a MIDI region.

  1. I import the region from another file
  2. I make it exactly 80 measures long by dragging the start and the end of the region
  3. I press T for stretch mode
  4. I grab the end of the region (the tooltip says 80|00|00)
  5. I stretch it to the left until the tooltip says 40|00|00
  6. I look at the region name, see that it says “regionName@49” (yesterday, same session, same file, was “regionName@52”)
  7. I check the alignment of the MIDI notes, and they are indeed a little bit faster.

With audio regions, it is possible to input the stretch factor manually.
With MIDI, it seems it is not possible.

Am I doing something wrong? I swear I did in the past without problems (I don’t need to do it very often though, so I cannot say in which version was working).

I also tried to manually change the midi file with a hex editor (the fourteenth byte), but I obviously messed up the file, Ardour won’t import the file.

Suggestions are very welcome, also external software is ok.

(Edit) half an hour later ...

I tried to do the same with Ardour 6.9.0 (where the to-be-imported region was originally created).
I see that there instead of measures is time on the tooltip. Impossible to stretch it correctly (also the original tempo was set to 160 bpm). So I set the tempo of the session to 120 (the minutes end on a measure), and I dragged the region (in grab mode) until it was exactly three minutes long. Stretched it to 1:30, then imported in Ardour 8.

It worked, but I swear this cannot be The Right Way™ to do it.

Based on my experience the only way to reliably change the tempo of a midi region in Ardour is to either use tempo mapping or change the tempo for the entire project.

Some clarity is needed here.

A MIDI region consists (most often) of a series of notes of a certain length. You can slow the MIDI region down to half-speed by doubling the length of all the notes. You can speed it up to double-speed by halving the length of all the notes.

However, on top of that, there is the tempo map, which defines how long a note of a given length last.

MIDI regions do not have their own inherent tempo. They always inherit (as of 2024) the global tempo.

So, if you stretch a MIDI region so that it is (for example) half-speed BUT then move it to another position on the timeline where the tempo (in terms of quarter-notes per minute) is different, then the MIDI region will play at a different speed.

We believe that this is by far the preferred behavior as a general rule.

If you were working with MIDI where the timing has no connection to musical time (i.e. tempo), then this is undesirable behavior. But supporting that means allowing MIDI events to be timed in units other than musical time, and that’s not something Ardour currently provides.

How is that accomplished? Edit mode → select all notes → right click → transform → “length of this note to exactly length of this note/2”? (I cannot try it right now)

Indeed.

In my case—as I tried to explain above, sorry I know it was not clear enough—I have only changed the tempo to get a BPM where the bars would be an exact sub-multiple of a minute (e.g. 120 BPM. In Ardour 6 the tooltip in time-stretch-mode is minutes:seconds:something, I wanted to get exactly half-length of the region, snapping on the bars).

I understand that.

Although, on a side note, I have noticed that using the grid tool(?) (shortcut Y) the MIDI region doesn’t change. I wasn’t expecting this behaviour, and I don’t remember having read about it. Is that a quirk or is that expected?

That won’t work, as i am importing a MIDI file from another session, where the tempo was 3/4, and in this session is 12/8. Moving from /4 to /8 makes the MIDI region double the length. Maybe I should just change the session time signature to 6/4.

But the original question stays: how do we stretch MIDI regions to a known percent value of the original? With the time-stretch-tool (shortcut T) I get unreliably results: sometimes 49%, sometimes 51 or 52% ( ← maybe they are rounded values, or it depends on the zoom level, not sure about it). I guess there is some command-line tool to achieve this kind of modifications, I don’t know. With audio regions is pretty straightforward.