File: conversions

package info (click to toggle)
abcmidi 20190101-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,236 kB
  • sloc: ansic: 30,486; sh: 427; makefile: 104
file content (93 lines) | stat: -rw-r--r-- 2,771 bytes parent folder | download
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
93
#!/bin/sh

# Author: Ross Gammon <rosco2@ubuntu.com>
#
# autopkgtest check: Tests all of the abcmidi command line tools.
# For example, converting between abc, midi & ps files.

set -e

echo "--------------------------------"
echo "ABC to ABC transposition test"
echo "--------------------------------"
echo "Retrieving sample abcfile"
cp /usr/share/doc/abcmidi/examples/araber.abc .
echo "Transpose the abc file up a semitone using abc2abc"
abc2abc araber.abc -t 1
echo "-----------------------------------"
echo "ABC to ABC transposition SUCCESS"
echo "-----------------------------------"
echo

echo "--------------------------------"
echo "ABC to MIDI conversion test"
echo "--------------------------------"
echo "Convert the file from abc to midi format using abcmidi"
abc2midi araber.abc
echo "-----------------------------------"
echo "ABC to MIDI conversion SUCCESS"
echo "-----------------------------------"
echo

echo "--------------------------------"
echo "Abcmatch test"
echo "--------------------------------"
echo "Retrieving demo.abc file"
cp /usr/share/doc/abcmidi/examples/demo.abc.gz .
echo "Unzipping demo.abc file"
gunzip demo.abc.gz
echo "Creating match.abc file"
cat > match.abc << EOF
X:1
M:4/4
L:1/8
K:G
B>G B>d g2 g2|
EOF
echo "Search for match.abc in demo.abc"
abcmatch demo.abc
echo "-----------------------------------"
echo "Abcmatch test SUCCESS"
echo "-----------------------------------"
echo

echo "--------------------------------"
echo "MIDI file to text test"
echo "--------------------------------"
echo "Print the araber47.mid file"
mftext araber47.mid
echo "-----------------------------------"
echo "MIDI file to text test SUCCESS"
echo "-----------------------------------"
echo

echo "--------------------------------"
echo "MIDI to ABC conversion test"
echo "--------------------------------"
echo "Convert the araber47.mid file back to abc"
midi2abc -f araber47.mid > araber48.abc
echo "-----------------------------------"
echo "MIDI to ABC conversion test SUCCESS"
echo "-----------------------------------"
echo

echo "--------------------------------"
echo "MIDI to MIDI copy test"
echo "--------------------------------"
echo "Copy tracks 1 & 3 from araber47.mid file to a new midi file"
midicopy -trks 1,3 araber47.mid araber48.mid
echo "-----------------------------------"
echo "MIDI to MIDI copy test SUCCESS"
echo "-----------------------------------"
echo

echo "--------------------------------"
echo "ABC to Postscript conversion test"
echo "--------------------------------"
echo "Convert araber.abc to a Postscript file"
yaps araber.abc
echo "-----------------------------------"
echo "ABC to Postscript conversion test SUCCESS"
echo "-----------------------------------"
echo
echo "conversions: TEST PASSED"