Stretching an audio track to match a pregiven fixed tempo?

Is it possible to:

  1. Import an audio track
  2. Select/mark an arbitrary range on that track
  3. Stretch/shrink the whole audio track so that the selected section lasts exactly n measures

Apologies if this problem has been solved—I did not find a solution on the forums or manuals, only very old discussions (2011 I believe) noticing that it could not be done. In one of these discussions, Robin linked to a video that showed how to solve the reverse problem—how to change the tempo track to match a live musician playing with varying tempi throughout the audio track. I’d like to do the opposite and keep the tempo track fixed while stretching/shrinking the audio.

  1. Set your tempo in the session

  2. Set your grid to bars

  3. turn on snapping

  4. drag the measure to start on a bar

  5. and then go to the time stretch tool and stretch it to end on the bar you want it to end on.

1 Like

If I understood the OP’s wish, Seablade’s solution stretches from the start and doesn’t do exactly what the OP wants.
You should :

  1. Use the range tool to select the arbitrary range
  2. In the Selection Clock Right click > switch to “samples” and write down the duration length (let’s call it d1)
  3. Using the Grid and Snapping, precisely select the n measures and write down the duration length (d2). (Can also be computed with the session’s sample rate and number of BPM, see “PS” below)
  4. In edition mode, right click the region > Name_of_the_region > Properties, write down the duration (d3)
  5. Maths : d4 (= target duration) = d3 x d2/d1
  6. Using the stretch tool, stretch to the precise value of d4, that can be entered manually in the window that appear when stretching (the clock can be set to samples by right clicking it)
  7. Place a sync point at the beginning of the range by placing the playhead, selecting the region and hitting the “v” key (too bad stretching removes sync points ! we could have done it easier at the beggining)
  8. move the region so that the sync point snaps to the bar you want.

Sounds terribly complicated, but it should be easy to do.

PS. in 4/4, d2 = nb of measures x (BPM/60) x sample rate

I think the Seablade’s way solves that request, if audio has constant tempo inside.

But here:

as I understood the imported audio contains varying tempo and if we want to match the global session tempo - we need the “warp audio tool” and stretch inside the region. As I know for that task we must make some marks on the audio (at the beginning of strong beats) and drag them to the main grid lines. Ardour has no such possibility today (again AFAIK). Actually as I understood it is about quantize audio to the main tempo grid.