summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-07 00:33:59 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-07 00:33:59 +0100
commit86b17d4b0bb27e6d9c585ccb07c186f037d5cf47 (patch)
treef0f9d34f24132616bc31ef50f78a3dcf3d5b6afd
parente8f89af07f9983a84c9eedc3ec5629af3e876ad2 (diff)
Add the test scripts and midi files.
They are old and not adapted yet.
-rw-r--r--sampling_alg_lac2020/.gitignore6
-rw-r--r--sampling_alg_lac2020/midi_tests/112_1016.midbin0 -> 28447 bytes
-rw-r--r--sampling_alg_lac2020/midi_tests/16_1016.midbin0 -> 28447 bytes
-rw-r--r--sampling_alg_lac2020/midi_tests/48_1016.midbin0 -> 28447 bytes
-rw-r--r--sampling_alg_lac2020/midi_tests/80_1016.midbin0 -> 28447 bytes
-rwxr-xr-xsampling_alg_lac2020/midi_tests/plot_histogram.py32
-rw-r--r--sampling_alg_lac2020/midi_tests/rise_0_127_8.midbin0 -> 28475 bytes
-rwxr-xr-xsampling_alg_lac2020/midi_tests/run_tests.sh22
-rwxr-xr-xsampling_alg_lac2020/midi_tests/test_and_plot.sh32
9 files changed, 92 insertions, 0 deletions
diff --git a/sampling_alg_lac2020/.gitignore b/sampling_alg_lac2020/.gitignore
index 14c85a9..25761ab 100644
--- a/sampling_alg_lac2020/.gitignore
+++ b/sampling_alg_lac2020/.gitignore
@@ -4,3 +4,9 @@ LAC-20.blg
LAC-20.log
LAC-20.out
LAC-20.pdf
+midi_tests/*.pdf
+midi_tests/*.txt
+midi_tests/new_wav/
+midi_tests/old_wav/
+midi_tests/drumgizmo_new
+midi_tests/drumgizmo_old
diff --git a/sampling_alg_lac2020/midi_tests/112_1016.mid b/sampling_alg_lac2020/midi_tests/112_1016.mid
new file mode 100644
index 0000000..f3723d8
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/112_1016.mid
Binary files differ
diff --git a/sampling_alg_lac2020/midi_tests/16_1016.mid b/sampling_alg_lac2020/midi_tests/16_1016.mid
new file mode 100644
index 0000000..ed79df1
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/16_1016.mid
Binary files differ
diff --git a/sampling_alg_lac2020/midi_tests/48_1016.mid b/sampling_alg_lac2020/midi_tests/48_1016.mid
new file mode 100644
index 0000000..6904777
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/48_1016.mid
Binary files differ
diff --git a/sampling_alg_lac2020/midi_tests/80_1016.mid b/sampling_alg_lac2020/midi_tests/80_1016.mid
new file mode 100644
index 0000000..7abb99e
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/80_1016.mid
Binary files differ
diff --git a/sampling_alg_lac2020/midi_tests/plot_histogram.py b/sampling_alg_lac2020/midi_tests/plot_histogram.py
new file mode 100755
index 0000000..ca529b7
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/plot_histogram.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+import numpy as np
+import matplotlib.mlab as mlab
+import matplotlib.pyplot as plt
+import sys
+
+if len(sys.argv) != 3:
+ print("Wrong number of arguments.")
+ print("USAGE: ./plot_histogram.py <input_file> <output_file>")
+ quit()
+
+input_file = sys.argv[1]
+output_file = sys.argv[2]
+
+f = open(input_file)
+X = [int(i) for i in f.readlines()]
+
+# the histogram of the data
+n, bins, patches = plt.hist(X, max(X)-min(X), facecolor='green')
+
+# add a 'best fit' line
+# y = mlab.normpdf( bins, mu, sigma)
+# l = plt.plot(bins, y, 'r--', linewidth=1)
+
+plt.xlabel('Sample Index')
+plt.ylabel('Number of Selections')
+# plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
+# plt.axis([40, 160, 0, 0.03])
+plt.xlim(0,97)
+plt.grid(True)
+
+plt.savefig(output_file)
diff --git a/sampling_alg_lac2020/midi_tests/rise_0_127_8.mid b/sampling_alg_lac2020/midi_tests/rise_0_127_8.mid
new file mode 100644
index 0000000..dd732ab
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/rise_0_127_8.mid
Binary files differ
diff --git a/sampling_alg_lac2020/midi_tests/run_tests.sh b/sampling_alg_lac2020/midi_tests/run_tests.sh
new file mode 100755
index 0000000..fbe2a51
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/run_tests.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+if [ "$#" != "3" ]; then
+ echo "Wrong number of parameters!"
+ echo "USAGE: ./run_tests.sh <midifile> <alg_type> <out_file>"
+ exit
+fi
+
+midifile="$1"
+alg="$2"
+output="$3"
+
+if [ "$alg" = "old" ]; then
+ echo "test with old selection..."
+ ./drumgizmo_old -i midifile -I file=/home/chaot/Data/midi_tests/$midifile -I midimap=~/Data/Drumkits/CrocellKit/Midimap_full.xml -o dummy ~/Data/Drumkits/CrocellKit/CrocellKit_full.xml | grep "index: " | awk '{print $8}' | sed 's/.$//' > "$output"
+ # ./drumgizmo_old -i midifile -I file=/home/chaot/Data/midi_tests/$midifile -I midimap=~/Data/Drumkits/CrocellKit/Midimap_full.xml -I speed=4 -o wavfile -O file="$3" ~/Data/Drumkits/CrocellKit/CrocellKit_full.xml
+ sort -n "$output" | uniq -c | awk '{print $2 " " $1}'
+elif [ "$alg" = "new" ]; then
+ echo "test with new selection..."
+ ./drumgizmo_new -i midifile -I file=/home/chaot/Data/midi_tests/$midifile -I midimap=~/Data/Drumkits/CrocellKit/Midimap_full.xml -I speed=1 -o dummy -p stddev=0 ~/Data/Drumkits/CrocellKit/CrocellKit_full.xml | grep "index: " | awk '{print $8}' | sed 's/.$//' > "$output"
+ # ./drumgizmo_new -i midifile -I file=/home/chaot/Data/midi_tests/$midifile -I midimap=~/Data/Drumkits/CrocellKit/Midimap_full.xml -I speed=8 -o wavfile -O file="$3" -p close=10,diverse=0.05,random=0.01,stddev=0 ~/Data/Drumkits/CrocellKit/CrocellKit_full.xml
+ sort -n "$output" | uniq -c | awk '{print $2 " " $1}'
+fi
diff --git a/sampling_alg_lac2020/midi_tests/test_and_plot.sh b/sampling_alg_lac2020/midi_tests/test_and_plot.sh
new file mode 100755
index 0000000..18101fa
--- /dev/null
+++ b/sampling_alg_lac2020/midi_tests/test_and_plot.sh
@@ -0,0 +1,32 @@
+# new
+./run_tests.sh rise_0_127_8.mid new sweep_new_output.txt
+./plot_histogram.py sweep_new_output.txt sweep_new.pdf
+#
+# ./run_tests.sh 16_1016.mid new 16_new_output.txt
+# ./plot_histogram.py 16_new_output.txt 16_new.pdf
+#
+# ./run_tests.sh 48_1016.mid new 48_new_output.txt
+# ./plot_histogram.py 48_new_output.txt 48_new.pdf
+#
+# ./run_tests.sh 80_1016.mid new 80_new_output.txt
+# ./plot_histogram.py 80_new_output.txt 80_new.pdf
+#
+# ./run_tests.sh 112_1016.mid new 112_new_output.txt
+# ./plot_histogram.py 112_new_output.txt 112_new.pdf
+
+
+# old
+# ./run_tests.sh rise_0_127_8.mid old sweep_old_output.txt
+# ./plot_histogram.py sweep_old_output.txt sweep_old.pdf
+#
+# ./run_tests.sh 16_1016.mid old 16_old_output.txt
+# ./plot_histogram.py 16_old_output.txt 16_old.pdf
+#
+# ./run_tests.sh 48_1016.mid old 48_old_output.txt
+# ./plot_histogram.py 48_old_output.txt 48_old.pdf
+#
+# ./run_tests.sh 80_1016.mid old 80_old_output.txt
+# ./plot_histogram.py 80_old_output.txt 80_old.pdf
+#
+# ./run_tests.sh 112_1016.mid old 112_old_output.txt
+# ./plot_histogram.py 112_old_output.txt 112_old.pdf