-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtest.sh
executable file
·93 lines (83 loc) · 3.05 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/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