Slide pitch with LINEAR rate

When I use the effect “Sliding Time Scale / Pitch Shift” to get a bent note effect, I get a logarithmic (I think) change in the pitch. That means, the speed of the change is much faster in the beginning then it is in the end. I am trying to get a linear bend (constant speed of change).

I’ve learned this page (from 2012) that apparently there used to be an option called “Slide Types” for “Sliding Time Scale / Pitch Shift” effect. It allowed one to choose between geometric (logarithmic) and linear change. But I don’t see this option in the current version.

I’m using Audacity 2.1.2 under Ubuntu 16.04 64-bit.

I suspect what you have now is linear and you want log. 400Hz or 440Hz is generally considered roughly half-way up the scale. That’s the oboe tone at the beginning of the orchestra. If you kept increasing the pitch in 400Hz jumps, you’d be at the upper end sometime next week. But if you went up by log (or octave) that would probably sound about right.


The current version of the “Sliding Time Scale/Pitch Shift” effect does not have that option.

When the effect was first introduced into Audacity, it was the only way that users could access the excellent “SBSMS” time-stretch algorithm. (The algorithm used in “Change Pitch” and “Change Tempo” has been “SOLA”, which is fast and can handle high stretch ratios, but tends to sound echoey and the resulting length is often not precise). For small to medium amounts of stretching, the SBSMS algorithm generally gives much higher quality. We wanted this high quality to be available to all users, so the “Sliding Time Scale/Pitch Shift” was deliberately given a simpler interface than earlier prototypes.

In the next version of Audacity (2.1.3), the SBSMS algorithm has been added as an option to the Change Pitch and Change Tempo effects, so I think that it would now be reasonable to add more features (specifically “slide type” options) to the “Sliding Time Scale/Pitch Shift” effect.

If you would like to add your support to the idea of (re-)adding “slide type” options, I’ll move this post to the “Adding Features” board so that your “vote” is counted.
If you are a software developer, you are very welcome to submit a patch to add this feature.

As a workaround, apply half of the amount of pitch shift twice.

In this example, 6 semitones stretch was applied twice to the upper track, and 12 semitones stretch added once to the lower track, Both tracks began life as a 1000 Hz sine tone:

Oh, sorry, I said log in relation to how many semitones it changes. But in relation to the frequency, it’s probably linear as you said. I think that makes sense.

Thanks for this tip!

I did some math and found that this approximation gets better the more times you apply the effect*. All the way to infinity! Of course making the number of iterations too high is not practical, and can even introduce error from dividing the amount of semitones desired by this huge number (I’m guessing, I didn’t test).

For raising the frequency from unchanged to an octave above, here is the maximum frequency error (that occurs in the middle of the audio) I calculated for each amount of iterations:

  1. 6.4%
  2. 3.5%
  3. 2.1%
  4. 2.1%
  5. 0.7%
    ∞) 0.0%
    For comparison, two consecutive semitones have their frequencies 5.6% apart.

These errors should be the same for any initial and final pitch shift that are one octave apart, since the result would only be shifted by a certain amount of semitones.
However, the percentage gets higher if the difference between the inicial and final pitch shift increases, and vice versa. Intuitively, if you raise a sound by only 1 semitone with this effect, you wouldn’t expect to have a 6.4% error anywhere, because that’s more than 1 semitone.

Conclusion: Applying the effect “Sliding Time Scale/Pitch Shift” twice or three times should give a good approximation for a linear semitones slide in most cases.

Notice: Please double check my results if you intend to use them.

* I’m assuming that the effect turns the signal f(t) 0<=t<=1 into (1+rt)f(t) when “inicial pitch shift” is set to 0 and “final” is set so the frequency at t=1 is multiplied by r+1. Assuming also that a linear semitones slide (desired) would turn f(t) into 2^t*f(t). The multiplications here are done in the frequencies.

Crossed posting. I was thinking that you wanted linear rate of frequency change.
The images that I posted show linear vertical scale, and as can be seen the rate of change in frequency from two applications is very close to linear.

For constant “semi-tone change / time” you would need the slide to be interpolated geometrically (the “ratio” of frequency change per unit time being constant).
As you say, this can be approximated by applying a very small change many times, but the downside is that the sound quality suffers.

There is still a workaround for constant rate pitch (frequency ratio), but it’s not very practical.
A Time Track can be used to change the pitch and tempo, with “logarithmic interpolation” not selected. Then use “Change Tempo” or “Sliding Time Scale / Pitch Shift” to restore the original tempo and length by stretching by a constant amount,