summaryrefslogtreecommitdiff
path: root/sampling_alg_lac2020/midi_tests/run_tests.sh
blob: bcf29ff74d8af46481d1a5240b6a8dbc80c18740 (plain)
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
#!/bin/bash
if [[ "$#" != "3" && "$#" != "5" ]]; then
	echo "Wrong number of parameters!"
	echo "USAGE: ./run_tests.sh <midifile> <alg_type> <out_file> <midimap> <kit>"
	exit
fi

midifile="$1"
alg="$2"
output="$3"
if [ "$#" == "5" ]; then
	midimap="$4"
	kit="$5"
else
	# Use Crocell as default
	midimap="/home/chaot/Data/Drumkits/CrocellKit/Midimap_full.xml"
	kit="/home/chaot/Data/Drumkits/CrocellKit/CrocellKit_full.xml"
fi

if [ "$alg" = "old" ]; then
	echo "test with old selection..."
	bin="./drumgizmo_old"
	parameters="-I speed=4 -p close=.8,diverse=0.05,random=0.02 -x -X attack=0,release=0,stddev=1.5"
elif [ "$alg" = "new" ]; then
	echo "test with new selection..."
	bin="./drumgizmo_new"
	parameters="-I speed=4 -p close=.9,diverse=0.04,random=0.01 -x -X attack=0,release=0,stddev=0"
fi

# $bin -i midifile -I file=$midifile -I midimap=$midimap $parameters -o wavfile -O file="$output" $kit | grep "index: " | awk '{print $8}' | sed 's/.$//' > "$output"
# sort -n "$output" | uniq -c | awk '{print $2 " " $1}'

$bin -i midifile -I file=$midifile -I midimap=$midimap $parameters -o dummy $kit | grep "index: " | awk '{print $20}' > "$output"
# sort -n "$output" | uniq -c | awk '{print $2 " " $1}'