@@ -10,10 +10,10 @@ function performTest() {
1010 sourceStem=$1
1111 category=$2
1212
13- echo " === ${category} (${sourceStem} ) test === ${soxCommands} "
13+ echo " --- ${category} (${sourceStem} ) test --- ${soxCommands[@] } "
1414 sourceFile=${sourceStem}${soxFileType}
1515 targetFile=${sourceStem} -${category} test${soxFileType}
16- ${sox} ${sourceFile} ${targetFile} ${soxCommands}
16+ ${sox} ${sourceFile} ${targetFile} " ${soxCommands[@]} "
1717}
1818
1919# --------------------
@@ -26,16 +26,18 @@ function makeBurstFile() {
2626 isChannelB=$2
2727
2828 noiseFile=part${soxFileType}
29- ${sox} -n ${soxFileSettings} ${noiseFile} ${soxCommands}
30-
31- if [ ${isChannelB} != " true" ] {
32- fileList=-v 0.2 ${noiseFile} -v 0.6 ${noiseFile}
33- } else {
34- fileList=-v 0.6 ${noiseFile} -v 0.2 ${noiseFile}
35- }
36-
37- fileList=${fileList} ${fileList}
38- ${sox} ${fileList} ${targetFileStem}${soxFileType} ${soxCommandsSuffix}
29+ ${sox} -n ${soxFileSettings[@]} ${noiseFile} " ${soxCommands[@]} "
30+
31+ if [ ${isChannelB} != " true" ]; then
32+ fileList=" -v 0.2 ${noiseFile} -v 0.6 ${noiseFile} " ;
33+ else
34+ fileList=" -v 0.6 ${noiseFile} -v 0.2 ${noiseFile} " ;
35+ fi
36+
37+ fileList=" ${fileList} ${fileList} "
38+ echo " --- burst file ${targetFileStem} --- ${soxCommandsSuffix[@]} "
39+ ${sox} ${fileList} ${targetFileStem}${soxFileType} \
40+ " ${soxCommandsSuffix[@]} "
3941}
4042
4143# ============================================================
@@ -44,89 +46,91 @@ function makeBurstFile() {
4446sox=sox
4547
4648# --- internal configuration ---
47- soxFileType=.flac
48- soxFileSettings=-b 24 -r 44100
49- durationInSecondsBy4=4
50- durationInSeconds=16
49+ soxFileType=" .flac"
50+ soxFileSettings=( -b 24 -r 44100)
51+ durationInSecondsByFour= " 4 "
52+ durationInSeconds=" 16 "
5153
5254# ==========================
5355# === prepare test files ===
5456# ==========================
5557
5658echo " === preparing test files ==="
57- soxCommandsSuffix=fade 0.1 -0 pad 1 1
59+ soxCommandsSuffix=( fade 0.1 -0 pad 1 1)
5860
5961# -- a stereo file with noise on one channel and sine on the other
6062# -- (both with two bursts)
61- soxCommands=synth ${durationInSecondsBy4 } pinknoise
62- CALL : makeBurstFile channelA false
63- soxCommands=synth ${durationInSecondsBy4 } sine 135
64- CALL : makeBurstFile channelB true
63+ soxCommands=( synth ${durationInSecondsByFour } pinknoise)
64+ makeBurstFile channelA false
65+ soxCommands=( synth ${durationInSecondsByFour } sine 135)
66+ makeBurstFile channelB true
6567${sox} -M channelA${soxFileType} channelB${soxFileType} noise${soxFileType}
6668
6769# -- two sine files, one with a sweep --
68- soxCommands=synth ${durationInSeconds} sine 100-5000 gain -6 remix 1 1
69- targetFile=sine-sweep${soxFileType}
70- ${sox} -n ${soxFileSettings} ${targetFile} ${soxCommands} ${soxCommandsSuffix}
70+ soxCommands=(synth ${durationInSeconds} sine 100-5000 gain -6 remix 1 1)
71+ targetFile=" sine-sweep${soxFileType} "
72+ ${sox} -n ${soxFileSettings[@]} ${targetFile} \
73+ ${soxCommands[@]} ${soxCommandsSuffix[@]}
7174
72- soxCommands=synth ${durationInSeconds} sine 500 remix 1 1
73- targetFile=sine-500Hz${soxFileType}
74- ${sox} -n ${soxFileSettings} ${targetFile} ${soxCommands} ${soxCommandsSuffix}
75+ soxCommands=(synth ${durationInSeconds} sine 500 remix 1 1)
76+ targetFile=" sine-500Hz${soxFileType} "
77+ ${sox} -n ${soxFileSettings[@]} ${targetFile} \
78+ ${soxCommands[@]} ${soxCommandsSuffix[@]}
7579
7680# =====================
7781# === perform tests ===
7882# =====================
7983
80- soxCommands=allpass 1050 3q
84+ echo " === performing tests ==="
85+
86+ soxCommands=(allpass 1050 3q)
8187performTest noise allpass
8288
83- soxCommands=band 1222 2.3q
89+ soxCommands=( band 1222 2.3q)
8490performTest noise band
8591
86- soxCommands=bandpass -c 520 2o
92+ soxCommands=( bandpass -c 520 2o)
8793performTest noise bandpass
8894
89- soxCommands=bandreject 1531 1q
95+ soxCommands=( bandreject 1531 1q)
9096performTest noise bandreject
9197
92- soxCommands=bass -1.23 536 2q
98+ soxCommands=( bass -1.23 536 2q)
9399performTest sine-sweep bass
94100
95- soxCommands=biquad 0.3 -0.5 0.3 2 -0.4 0.1
101+ soxCommands=( biquad 0.3 -0.5 0.3 2 -0.4 0.1)
96102performTest noise biquad
97103
98- soxCommands=compand 0.02,0.15 -4:-60,0,-20 +4.5
104+ soxCommands=( compand 0.02,0.15 -4:-60,0,-20 +4.5)
99105performTest noise compander
100106
101- soxCommands=equalizer 520 2o -3
107+ soxCommands=( equalizer 520 2o -3)
102108performTest sine-sweep equalizer
103109
104- soxCommands=gain -7.5
110+ soxCommands=( gain -7.5)
105111performTest noise gain
106112
107- soxCommands=highpass -1 2750
113+ soxCommands=( highpass -1 2750)
108114performTest sine-sweep highpass
109115
110- soxCommands=lowpass -2 250 2o
116+ soxCommands=( lowpass -2 250 2o)
111117performTest noise lowpass
112118
113- soxCommands=overdrive 3 40
119+ soxCommands=( overdrive 3 40)
114120performTest noise overdrive
115121
116- soxCommands=mcompand " 0.02,0.15 4:-60,0,-20 +4.5" 1000
117- soxCommands= ${soxCommands} " 0.15,0.4 -20,0,-10 -2"
122+ soxCommands=( mcompand " 0.02,0.15 4:-60,0,-20 +4.5" )
123+ soxCommands+=(1000 " 0.15,0.4 -20,0,-10 -2" )
118124performTest noise mcompander
119125
120- soxCommands=phaser 0.6 0.66 3 0.6 0.5 -t
126+ soxCommands=( phaser 0.6 0.66 3 0.6 0.5 -t)
121127performTest noise phaser
122- performTest sine-sweep phaser
123128
124- soxCommands=reverb 60 22 87.5 34.88 20 -3
129+ soxCommands=( reverb 60 22 87.5 34.88 20 -3)
125130performTest noise reverb
126131
127- soxCommands=treble +2.75 5200 2o
132+ soxCommands=( treble +2.75 5200 2o)
128133performTest noise treble
129134
130- soxCommands=tremolo 0.395 94.67
135+ soxCommands=( tremolo 0.395 94.67)
131136performTest sine-sweep tremolo
132-
0 commit comments