Using Gsnap to correct the pitch

Hi everybody,

and happy new year where the new year already came and happy new year’s day night where it is coming.

I’ve tried today to use Gsnap to correct the pitch in some part of an audio track recording using the latest version of Audacity.
The pitch correction is very good, the problem is that I select a part of the wav audio track and after that I apply the change at the beginning of the selection there is a short “mute” space in the wave and if I play the track I hear a kind of imperfection on that point.

Is there any trick to fix this while doing the conversion or changing some Audacity setting ?

Thanks in advance to anybody who can reply.

Happy 2014 !!!

A lot of external VST plug-ins work FFT-based. FFT is executed over a certain frame e.g. 1024 samples. Those frames are first multiplied by a window to smooth the result.
Imagine a triangular window that emphases the center of the window. For a overlap of 50 %, the output gain will be equal to one, except for the beginning and ending where you’ll see a ramp-like fade-in/-out.
Thus, you have to artificially add a certain amound of sound (silence) before applying the gsnap effect and remove the created fades afterwards.
We could for example make a nyquist switcher plug-in that adds or removes silence at the start with each call.
However, you should first test if my assumption is correct.
Generate a test tone (high-pitched square-wave). Select a region from this test signal, remember the length in samples and apply Gsnap.
Now the questions:

  • Has the length of the selection changed?
  • Is there a curve visible at for the beginning/end like a fade?
  • If so, is the length approximately an exponential of 2 (256, 512, 1024 etc samples)?

Thanks for the explanation,

I’m a beginner in wave audio edit, Until now I’ve used Audacity only for some little edit like “remove noise” on wave track recordings.

I will try to understand better your post and try to do something…

About your questions:

  • Has the length of the selection changed? No, the lenght of the selection remain the same (including the “mute” part at the beginning), but the lenght of the real audio is shorter, it is the same with also the “mute” part at the beginning.
  • Is there a curve visible at for the beginning/end like a fade? No

Many thanks

But there’s still a gap at the beginning of the processed test signal, isn’t there?

Yes, it is like this.

I get the same issue with GSnap, irrespective of attack time. Whatever the sample rate, 10 milliseconds of silent audio are inserted at the start of the processed selection, and 10 milliseconds of the selection are removed at the end.

I have not tried GSnap in other hosts but I think the issue is probably Audacity’s lack of buffer delay compensation: .

You could try Effect > Truncate Silence after GSnap.


But this doesn’t the right side snipping, does it?
As I do see it, we’ll need two plug-ins,

  • The first one adds 10 ms at the end (before Gsnap).
  • The second one removes 10 ms from the beginning (after Gsnap).
    That are almost the same functions that I’ve used for the 10 ms left/right shift helper from the recent Latency issue topic.
    Gayle, are those 10 ms accurate or do we have to reckon with other values for other sound cards/configurations?
    Could one please attach a wave-file with the first muted part with some audio samples enclosing it.

Thanks for the suggestions,

I try know to do it manually.
I can insert 10 milliseconds of silence at the end of the selection before to use Gsnap,
then I will delete the 10 milliseconds at the beginning of the edited selection after Gsnap has been applied.
I’ve tried in one part and it worked well without any noise in the final result.

Many thanks

Correct, it does not fix the loss at the end of the selection (if you can hear it).

Also even if you manually selected 10 ms excess (generated silence) at the end of the selection before running GSnap, Truncate Silence only truncates silence to 1 ms. So although you could not hear that 1 ms of silence, using that automatic method would change the track length.

The 10 ms is consistent for my devices and hosts.

Here is a 200 ms WAV comprising a sine tone, 10 ms of square wave and 10 ms of noise. If you apply GSnap to that you should retain all the audio, displaced 10 ms to right.


Thank you Gale,
I actually meant the Audio after processing. However, I’ve realized that there’s an old version of gsnap already installed in the effect menu.

There are indeed 440 samples (at 44.1 kHz) added to the beginning, after Gsnap + 1 interpolated sample, i.e. non-zero.

I don’t think that the manual extension/shrinking is very efficient leastways if you don’t wanna go nuts after a few dozen times.
Here are the two Nyquist plug-ins that should facilitate the task immensely.
Extract the two tools and put them in the audacity plug-ins folder. Restart Audacity.
One is to use before gSnap (GSnap Pre)and the other after (GSnap Post).
You can further assign shortcuts to those effects, e.g. Ctrl-Right/Laft. (931 Bytes)

Thanks you for your suggestions
and for the very useful plug-in.

I’ve used it in some part of the track but in some point I wasn’t able to correct the pitch with Gsnap (I don’t know why it didn’t change) so I have used for the most part of the track the standard Audacity plugin “Change pitch” and I was able to do what I was looking for …

So, many thanks to both Gsnap and Audacity