pitsh
is a simple program provides two functions: (1) pitch shifter (2) time stretcher. Meanwhile, this program is developed by a beginner and the results which this program produces are somewhat unsatisfactory in that there are some perceivable noises in those.
Executing make
command in the root directory will produce pitsh
, the executable. Meanwhile, one may find it helpful to type make help
to find the effect of make clean
command.
If one should be in need of compiling the program manually, e.g. make
is not available, then it must be no problem to compile/link every .c files from the src
directory in order to get the executable.
./pitsh --help
./pitsh --src in.wav --dest out.wav --pitch 0.84
./pitsh -S in.wav -D out.wav -P 0.84 // abbreviated
./pitsh ... --speed 1.2
./pitsh ... -T 1.2 // abbreviated
Note. It would be helpful to use the following formula to get values for --pitch
command: 2^(n/12).
Example: 3 half tones down = 2^(-3/12) = 0.84
Command Line Arguments | ||
---|---|---|
--help | displays the manual that you are reading now. | |
--src or -S | specifies the name of the input .wav file. Required to run. | |
--dest or -D | specifies the name of the output .wav file. Required to run. | |
--pitch or -P | modifies pitch, meanwhile keeping speed the same. The value of 2 would yield 1 octave high. Range: 0 ~ 3 (inclusive). Required, but can't be set with --speed together. | |
--speed or -T | modifies speed, meanwhile keeping pitch the same. The value of 2 would yield the doubled length. Range: 0 ~ 3 (inclusive). Required, but can't be set with --pitch together. | |
[--size] | assigns a specific grain size: 2205 ~ 8820 (inclusive). Optional. | |
[--verbose] | displays the metadata of the input .wav file. Optional. | |
--src* / -S* --dest* / -D* |
These are what I call environment variable suppression commands. Please refer to the below section for the detailed description. |
I found it inconvenient that I had to type the paths to .wav files all the time. From this reason, I've had the program read the .env
file where the pre-defined --src and --dest paths are written. Meanwhile, it would be helpful to use the *
character if it is desired to provide a full path manually.
/* Suppose that .wav files are in ./src directory,
but I do not want to type 'src/' every time in
front of the names of the .wav files. */
/* Without the .env file, */
./pitsh --src src/music.wav --dest dest/result.wav --pitch 1.06
/* With .env file written as follows, */
SRC_PATH src/
DEST_PATH dest/
./pitsh --src music.wav --dest result.wav --pitch 1.06
/* If I want to search from a different directory,
I can put the asterisk right after --src (= -S)
command so that I can ignore the SRC_PATH. */
./pitsh --src* other_dir/music.wav --dest result.wav --pitch 1.06
/* This 'suppression' can be applied to --dest (= -D) also. */
.env File Structure | ||
---|---|---|
# | represents a comment line, if and only if the line starts with the '#' character. Comment lines are ignored. | |
SRC_PATH | represents the path from which the program will look for input .wav files. | |
DEST_PATH | represents the path to which the program will save the result. |