EditPlaybackContext()->setSpeedCompensation

Hi,

I am creating an application and it will have a global speed adjustment. The application has 2 simple tracks with clips loaded on them. Currently I am adjusting the speed of both clips and readjusting their length.

I found this method EditPlaybackContext()->setSpeedCompensation and was wondering how it’s used? I tried to set it but it makes no audible difference.

Does anyone have any experience with it?

Do you just want a speed change (resampling) or a tempo change (time-stretching)?

The former will change pitch as well as speed.

Yeah i want to change both pitch and speed, i’m not hearing any difference though.

First you need to ensure your audio and MIDI clips aren’t using proxy files, call setUsesProxy (false) on them.

Then you you can either change the tempo using Edit::tempoSequence or temporarily nudge the tempo up and down with `EditPlaybackContext::setTempoAdjustment``

setSpeedCompensation just resamples the block.

That totally worked :smile:

I wanted both the pitch and speed to change which it does for my audio files (i’m not using any MIDI).

It’s not clear in the documentation but it says for the setTempoAdjustment method that “This will increase/decrease playback speed by changing the tempo, maintaining pitch where possible.”

When is it possible to maintain pitch? For MIDI?

Also there was no reason for me to be using proxies, now my app is so much faster!