EditTimeRange and Tempo confusion

I could use some help understanding EditTimeRange with regards to tempo. If I set a loop range for the transport and reduce the tempo by half, the loop range will also reduce by half. What I want is for the loop range to stay the same when the tempo changes.

What am I missing?

Just set the loop range again after you change the tempo.
It’s done like that deliberately so if you’re looping a section, changing the tempo will just speed up that section or slow it down, not leave a gap at the end or chop some material off.

Hope that makes sense.

Is this the same for clips as well?

They’ll adjust time if they have the they SyncType set to syncBarsBeats. See Clip::setSyncType.

You might also want to have a look at EditTimecodeRemapperSnapshot which is where this stuff gets remapped in response to a tempo change.

1 Like