Take an input .wav file and shift the pitch without changing the speed or length of the input file.
Require: Python 3.7+
$ git clone https://github.com/cwoodall/pitch-shifter-py.git
$ cd pitch-shifter-py
$ pip install .
For development virtualenv
is recommended:
$ virtualenv venv
$ . ./venv/bin/activate
$ pip install .
On systems where specific versions of scipy
and numpy
might be needed, those should be installed seperately (using conda
or other means)
The following command will shift the tone up an octave (12
semitones) and blend it so that both have equal volume (.5
)
$ pitchshifter -s ./samples/sample1.wav -o out.wav -p 12 -b .5
This example shifts up a fifth (7
semitones) and blends it so it is all the new shifted version:
$ pitchshifter -s ./samples/sample1.wav -o out.wav -p 7 -b 1
With some tweaking you can also use this script to slow down and speed up music using the --no-resample
switch. To
double the speed shift up and octave (12
), but don't resample:
$ pitchshifter -s ./samples/sample1.wav -o out.wav -p 12 --no-resample
To half the speed shift down an octave (-12
), but don't resample:
$ pitchshifter -s ./samples/sample1.wav -o out.wav -p -12 --no-resample
Input --> Phase Vocoder (Stretch or compress by 2^(n/12)) --> resample by 2^(n/12)
- Guitar Pitch Shifter by François Grondin
- Phase Vocoder Tutorial by Mark Dolson
- NEW PHASE-VOCODER TECHNIQUES FOR PITCH-SHIFTING, HARMONIZING AND OTHER EXOTIC EFFECTS by Laroche and Dolson
- Phase-Vocoder: About this phasing business by Laroche and Dolson
- Phase Locked Vocoder by Puckette
- Improved Phase Vocoder Time-Scale Modification of Audio by Laroche and Dolson