1MIDI2ABC(1) General Commands Manual MIDI2ABC(1)
2
3
4
6 midi2abc - program to convert MIDI format files to abc notation
7
9 midi2abc -f infile [-xa] [-ga] [-a acbeats] [-m time signature] [-ppu
10 parts per unit] [-aul denominator of unit length] [-gu] [-b bars] [-Q
11 tempo] [-u pulses] [-k key] [-c channel] [-obpl] [-bpl bars] [-bps
12 bars] [-o filename] [-s] [-sr units] [-sum] [-nt] [-splitbars]
13 [-splitvoices] [-midigram] [-mftext] [-nogr]
14
15
17 midi2abc takes a MIDI format file and converts it to something as close
18 as possible to abc text format. The user then has to add text fields
19 not present in the MIDI header and possibly tidy up the abc note out‐
20 put.
21
22 The output of midi2abc is printed to the screen. To save it to a file,
23 use the redirection operator, (e.g. midi2abc -f file.mid > file.abc) or
24 specify the output file using the -o option.
25
26 Use only one or none of the options -u -gu, -b and -Q. Midi2abc nor‐
27 mally converts the MIDI time units into quantum units normally corre‐
28 sponding to the abc 1/16th note or 1/32nd note. If none of these is
29 present, the program will use the PPQN information in the MIDI header
30 to compute the suitable conversion factor. For most MIDI files on the
31 web, it is recommended to rely on the MIDI header information and not
32 use any of the options other than the formatting options.
33
34 The program will extract the time signature infromation from the MIDI
35 file if it is present. Otherwise it will assume 4/4 or you could spec‐
36 ify it with -m. option.
37
38 If the tune has an anacrusis, you can use either the -ga or -xa option
39 to estimate the its length. Alternatively, you can specify its value
40 using the -a option. The anacrusis is specified in half unit lengths,
41 where the unit length is defined by the L: field. For example if L:
42 1/8, then a quarter note would be indicated by the value 4, (4 1/16
43 units).
44
45 OPTIONS
46 -a acbeats
47 where acbeats specifies the anacrusis in half unit lengths.
48
49 -xa extract the anacrusis from file by finding the first strong note
50
51 -ga guess the anacrusis by minimizing the number of ties across bars
52
53 -m time signature
54 time signature
55
56 -b bars
57 number of bars wanted in output
58
59 -Q tempo
60 tempo in quarter-notes per minute
61
62 -u pulses
63 Allows you to specify directly the number of midi pulses per abc
64 time unit.
65
66 -ppu parts per abc unit length
67 Normally, the smallest note unit that midi2abc can extract is
68 half the L: unit length.This is called the quantum unit. Thus
69 for L: 1/8, midi2abc can extract 1/16 notes but not 1/32 notes.
70 You can change this by specifying -ppu 4 for example. The number
71 of parts should be a power of 2.
72
73 -aul denominator of abc unit length
74 Normally midi2abc chooses a unit length of 1/8 or 1/16 depending
75 upon the time signature. For time signatures smaller than 3/4
76 the L: 1/16 is used and for larger time signatures L: 1/8 is
77 used. You can specify the unit length to be used using this
78 parameter. Thus -aul 32 will cause midi2abc to use a unit length
79 of 1/32 nd note.
80
81 -gu Tells midi2abc to estimate the number of midi pulses per abc
82 time unit from the note duration or spacing in the MIDI file.
83
84 -gk Tells midi2abc to guess the key signature by minimizing the num‐
85 ber of accidentals even if the key signature is already speci‐
86 fied in the MIDI file. By default the key signature is the one
87 specified in the MIDI file. If it is not specified, then the
88 program guesses the key signature by minimizing accidentals.
89
90 -k key key signature: -6 to 6 sharps.
91
92 -c channel
93 select only this midi channel.
94
95 -f infile
96 input file in midi format
97
98 -o output file
99 specifies the output abc file name.
100
101 -s do not discard very short notes.
102
103 -sr quantum units
104 do not notate a short rest smaller than the specified size after
105 a note. If the size (in quantum units) is zero, nothing is done.
106 For larger values, the rest is absorbed into the preceding note.
107 In other words, the preceding note is lengthened to include that
108 rest.
109
110 -sum print a short summary of the input midi file.
111
112 -nt do not look for triplets or broken rhythm
113
114 -obpl Print only one bar per line instead of 4. For complex music this
115 improves the readability and avoids some problems with some abc
116 to postscript converters. This option is deprecated.
117
118 -nogr (No note grouping.) Inserts a space between all notes. It makes
119 a less pretty postscript file but it is easier to edit.
120
121 -bpl nbars
122 Print nbars of music on every line followed by a backslash.
123
124 -bps nbars
125 When nbars have been printed (including those lines joined by a
126 backslash continuation) go to a new line (with no backslash).
127
128 -splitbars
129 This parameter changes the way midi2abc prints chords composed
130 of notes of unequal length (polyphonic chords). Normally,
131 midi2abc joins the longer notes to the notes in the following
132 chord using ties. A more readable output, can be obtained if the
133 measure is split into separate parts using the '&' feature in
134 abc notation. The algorithm for dividing the notes in a poly‐
135 phonic chord to separate voices (label_splits in midi2abc.c)
136 needs some improvement. I welcome any assistance.
137
138 -splitvoices
139 This parameter like above handles polyphonic chords by splitting
140 an entire voice into multi voices.
141
142 -midigram
143 When this option appears, all other options are ignored and no
144 abc file is produced. Instead a list of all notes in the MIDI
145 file are printed in a fixed format. Each line represents a pair
146 of MIDI note on/off event. The line contains the on/off time of
147 the note, its track number, channel number, midi pitch and midi
148 velocity. The last record indicates the duration of the MIDI
149 file in MIDI pulse units. The output is designed to go into a
150 graphical user interface which will produce a graphical repre‐
151 sentation (piano roll).
152
153 -mftext
154 When this option appears, all other options are ignored and no
155 abc file is produced. Instead a list of all the MIDI commands
156 are printed. The output is designed to go into a graphical user
157 interface provided by runabc.tcl.
158
159
160 FEATURES
161 * The key is chosen so as to minimize the number of accidentals.
162 Alternatively, the user can specify the key numerically (a positive
163 number is the number of sharps, a negative number is minus the number
164 of flats).
165
166 * Note length can be set by specifiying the total number of bars or the
167 tempo of the piece. Alternatively the note length can be read from the
168 file. However, by default it is deduced in a heuristic manner from the
169 inter-note distances. This means that you do not have to use the MIDI
170 clock as a metronome when playing in a tune from a keyboard.
171
172 * Barlines are automatically inserted. The user specifies the number of
173 measures in the anacrusis before the first barline and the time signa‐
174 ture.
175
176 * The program can guess how the length of the anacrusis, either by
177 looking for the first strong note or minimizing the number of notes
178 split by a tie across a barline.
179
180 * Where a note extends beyond a bar break, it is split into two tied
181 notes.
182
183 * The output has 4 bars per line.
184
185 * Enough accidental signs are put in the music to ensure that no pitch
186 errors occur if a barline is added or deleted.
187
188 * The program attempts to group notes sensibly in each bar.
189
190 * Triplets and broken rhythm (a>b) are supported.
191
192 * Chords are identified.
193
194 * Text information from the original MIDI file is included as comments.
195
196 * The -c option can be used to select only 1 MIDI channel. Events on
197 other channels are ignored.
198
199 LIMITATIONS
200 midi2abc does not ...
201
202 * Supply tune title, composer or any other field apart from X: , K:,
203 Q:, M: and L: - these must be added by hand afterwards, though they may
204 have been included in the text of the MIDI file.
205
206 * Support duplets, quadruplets, other esoteric features.
207
208 * Support mid-tune key or time signature changes.
209
210 * Deduce repeats. The output is just the notes in the input file.
211
212 * Recover an abc tune as supplied to abc2midi. However, if you want to
213 do this, "midi2abc -xa -f file.mid" comes close.
214
216 abc2ps(1), abc2midi(1), abc2abc(1)
217
219 James Allwright <J.R.Allwright@westminster.ac.uk>
220
222 Seymour Shlien <seymour.shlien@crc.ca>
223
225 This man page describes midi2abc version 2.87 from July 09 2005.
226
228 Copyright 1999 James Allwright
229
230 midi2abc is supplied "as is" without any warranty. It is free software
231 and can be used, copied, modified and distributed without fee under the
232 terms of the GNU General Public License.
233
234
235
236
237 09 July 2005 MIDI2ABC(1)