-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean-up in preparation for a version 0.4 release
- add .gitignore file and build.sh and test.sh scripts (thanks hayguen) - clear sample history on stretch_flush() as well as stretch_reset() - update README and improve in-line code documentation
- Loading branch information
Showing
6 changed files
with
189 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output | ||
audio-stretch | ||
samples/*.wav | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ] || [ "$1" = "rel" ]; then | ||
echo "building release .." | ||
gcc -Ofast main.c stretch.c -lm -o audio-stretch | ||
elif [ "$1" = "dbg" ]; then | ||
echo "building debug .." | ||
gcc -O0 -g main.c stretch.c -lm -o audio-stretch | ||
elif [ "$1" = "ubsan" ]; then | ||
echo "building debug with undefined behaviour sanitizer .." | ||
gcc -O0 -g main.c stretch.c -fsanitize=undefined -lm -o audio-stretch | ||
elif [ "$1" = "asan" ]; then | ||
echo "building debug with address sanitizer .." | ||
gcc -O0 -g main.c stretch.c -fsanitize=address -lm -o audio-stretch | ||
else | ||
echo "error: unknown option '$1'" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d output ]; then | ||
echo "creating directory output" | ||
mkdir output | ||
fi | ||
|
||
if [ ! -f samples/mono.wav ] || [ ! -f samples/stereo.wav ]; then | ||
WVUNPACK=$(which wvunpack) | ||
if [ -z "$WVUNPACK" ]; then | ||
echo "please build/install WavPack with wvunpack to convert .wv samples to .wav" | ||
exit 1 | ||
fi | ||
$WVUNPACK samples/mono.wv | ||
$WVUNPACK samples/stereo.wv | ||
fi | ||
|
||
STARTER="" | ||
if [ "$1" = "gdb" ]; then | ||
STARTER="gdb -q -ex run -ex quit --args" | ||
shift | ||
fi | ||
|
||
EXAMPLE="mono" | ||
if [ "$1" = "mono" ]; then | ||
EXAMPLE="$1" | ||
shift | ||
fi | ||
if [ "$1" = "stereo" ]; then | ||
EXAMPLE="$1" | ||
shift | ||
fi | ||
|
||
|
||
if [ -z "$1" ] && [ -z "$2" ]; then | ||
echo "usage: $0 [mono|stereo] [f|n] [s|x]" | ||
echo " 'f': fast pitch detection" | ||
echo " 'n': normal pitch detection" | ||
echo " 's': simple range for ratio: 0.5 .. 2.0" | ||
echo " 'x': extended range for ratio: 0.25 .. 4.0" | ||
echo "" | ||
fi | ||
|
||
if [ -z "$1" ] || [ "$1" = "f" ]; then | ||
echo "testing with fast pitch detection" | ||
FO="-f" | ||
FN="f" | ||
else | ||
echo "testing with normal pitch detection" | ||
FO="-n" | ||
FN="n" | ||
fi | ||
|
||
|
||
if [ -z "$2" ] || [ "$2" = "s" ]; then | ||
echo "" | ||
echo "testing normal range 0.5 .. 2.0" | ||
echo "x2.0" | ||
$STARTER ./audio-stretch -q -y $FO -r0.5 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r050_x200.wav | ||
echo "x1.75" | ||
$STARTER ./audio-stretch -q -y $FO -r0.571 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r057_x175.wav | ||
echo "x1.5" | ||
$STARTER ./audio-stretch -q -y $FO -r0.666 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r066_x150.wav | ||
echo "x1.25" | ||
$STARTER ./audio-stretch -q -y $FO -r0.8 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r080_x125.wav | ||
echo "x1.0" | ||
$STARTER ./audio-stretch -q -y $FO -r1.0 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r100_x100.wav | ||
echo "x0.75" | ||
$STARTER ./audio-stretch -q -y $FO -r1.333 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r133_x075.wav | ||
echo "x0.5" | ||
$STARTER ./audio-stretch -q -y $FO -r2.0 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r200_x050.wav | ||
fi | ||
if [ -z "$2" ] || [ "$2" = "x" ]; then | ||
echo "" | ||
echo "testing extended range 0.25 .. 0.5 and 2.0 .. 4.0" | ||
echo "x4.0" | ||
$STARTER ./audio-stretch -q -y $FO -r0.25 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r025_x400.wav | ||
echo "x3.5" | ||
$STARTER ./audio-stretch -q -y $FO -r0.285 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r028_x350.wav | ||
echo "x3.0" | ||
$STARTER ./audio-stretch -q -y $FO -r0.333 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r033_x300.wav | ||
echo "x2.5" | ||
$STARTER ./audio-stretch -q -y $FO -r0.4 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r040_x250.wav | ||
echo "x0.4" | ||
$STARTER ./audio-stretch -q -y $FO -r2.5 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r250_x040.wav | ||
echo "x0.333" | ||
$STARTER ./audio-stretch -q -y $FO -r3.0 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r300_x033.wav | ||
echo "x0.285" | ||
$STARTER ./audio-stretch -q -y $FO -r3.5 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r350_x028.wav | ||
echo "x0.25" | ||
$STARTER ./audio-stretch -q -y $FO -r4.0 samples/${EXAMPLE}.wav output/out_${EXAMPLE}_${FN}_r400_x025.wav | ||
fi | ||
|