Fix an issue where the pattern doesn't advance,
[quincer.git] / test / 10prefix.test
blob6e74507b92ccc5265247d189ae32b525b5af9289
1 #!/bin/sh
2 set -x
3 input=$(mktemp)
4 output=$(mktemp)
6 die() {
7 echo output was
8 cat $output
9 rm -f $input $output
10 exit 1
13 cat >$input <<EOF
14 voice lead synth 1
15 pattern 132 0
16 A 57 80
17 e 64 80
18 a 69 80
19 .'.0.'.'.'.
20 e A a | lead
21 EOF
23 ./lexdump $input >$output
24 [ $? = 0 ] || die
26 grep "ticks_per_beat: 2" $output || die
27 grep "beats_per_bar: 4" $output || die
29 (grep -A 34 "voice: lead" $output | grep "nbeats: 4") || die
30 (grep -A 34 "voice: lead" $output | grep "nevents: 6") || die
32 (grep -A 35 "voice: lead" $output | grep -A 5 "start: -3" | grep "byte 0: 144") || die
33 (grep -A 35 "voice: lead" $output | grep -A 5 "start: -3" | grep "byte 1: 64") || die
34 (grep -A 35 "voice: lead" $output | grep -A 5 "start: -3" | grep "byte 2: 80") || die
36 (grep -A 35 "voice: lead" $output | grep -A 5 "start: -2" | grep "byte 0: 128") || die
37 (grep -A 35 "voice: lead" $output | grep -A 5 "start: -2" | grep "byte 1: 64") || die
39 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 0" | grep "byte 0: 144") || die
40 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 0" | grep "byte 1: 57") || die
41 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 0" | grep "byte 2: 80") || die
43 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 1" | grep "byte 0: 128") || die
44 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 1" | grep "byte 1: 57") || die
46 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 2" | grep "byte 0: 144") || die
47 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 2" | grep "byte 1: 69") || die
48 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 2" | grep "byte 2: 80") || die
50 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 3" | grep "byte 0: 128") || die
51 (grep -A 35 "voice: lead" $output | grep -A 5 "start: 3" | grep "byte 1: 69") || die
53 echo output was
54 cat $output
55 rm -f $input $output