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] [-nb] [-nt] [-splitvoices]
13 [-midigram] [-mftext] [-mftextpulses] [-nogr] [-title string] [-origin
14 string]
15
16
17
18
20 midi2abc takes a MIDI format file and converts it to something as close
21 as possible to abc text format. The user then has to add text fields
22 not present in the MIDI header and possibly tidy up the abc note out‐
23 put.
24
25 The output of midi2abc is printed to the screen. To save it to a file,
26 use the redirection operator, (e.g. midi2abc -f file.mid > file.abc) or
27 specify the output file using the -o option.
28
29 Use only one or none of the options -u -gu, -b and -Q. Midi2abc nor‐
30 mally converts the MIDI time units into quantum units normally corre‐
31 sponding to the abc 1/16th note or 1/32nd note. If none of these is
32 present, the program will use the PPQN information in the MIDI header
33 to compute the suitable conversion factor. For most MIDI files on the
34 web, it is recommended to rely on the MIDI header information and not
35 use any of the options other than the formatting options.
36
37 The program will extract the time signature information from the MIDI
38 file if it is present. Otherwise it will assume 4/4 or you could spec‐
39 ify it with -m. option.
40
41 If the tune has an anacrusis, you can use either the -ga or -xa option
42 to estimate the its length. Alternatively, you can specify its value
43 using the -a option. The anacrusis is specified in half unit lengths,
44 where the unit length is defined by the L: field. For example if L:
45 1/8, then a quarter note would be indicated by the value 4, (4 1/16
46 units).
47
48 OPTIONS
49 -a acbeats
50 where acbeats specifies the anacrusis in half unit lengths.
51
52 -xa extract the anacrusis from file by finding the first strong note
53
54 -ga guess the anacrusis by minimizing the number of ties across bars
55
56 -m time signature
57 time signature
58
59 -b bars
60 number of bars wanted in output
61
62 -Q tempo
63 tempo in quarter-notes per minute
64
65 -u pulses
66 Allows you to specify directly the number of midi pulses per abc
67 time unit.
68
69 -ppu parts per abc unit length
70 Normally, the smallest note unit that midi2abc can extract is
71 half the L: unit length.This is called the quantum unit. Thus
72 for L: 1/8, midi2abc can extract 1/16 notes but not 1/32 notes.
73 You can change this by specifying -ppu 4 for example. The number
74 of parts should be a power of 2.
75
76 -aul denominator of abc unit length
77 Normally midi2abc chooses a unit length of 1/8 or 1/16 depending
78 upon the time signature. For time signatures smaller than 3/4
79 the L: 1/16 is used and for larger time signatures L: 1/8 is
80 used. You can specify the unit length to be used using this
81 parameter. Thus -aul 32 will cause midi2abc to use a unit length
82 of 1/32 nd note.
83
84 -gu Tells midi2abc to estimate the number of midi pulses per abc
85 time unit from the note duration or spacing in the MIDI file.
86
87 -gk Tells midi2abc to guess the key signature by minimizing the num‐
88 ber of accidentals even if the key signature is already speci‐
89 fied in the MIDI file. By default the key signature is the one
90 specified in the MIDI file. If it is not specified, then the
91 program guesses the key signature by minimizing accidentals.
92
93 -k key key signature: -6 to 6 sharps.
94
95 -c channel
96 select only this midi channel.
97
98 -f infile
99 input file in midi format
100
101 -o output file
102 specifies the output abc file name.
103
104 -s do not discard very short notes.
105
106 -sr quantum units
107 do not notate a short rest smaller than the specified size after
108 a note. If the size (in quantum units) is zero, nothing is done.
109 For larger values, the rest is absorbed into the preceding note.
110 In other words, the preceding note is lengthened to include that
111 rest.
112
113 -sum print a short summary of the input midi file.
114
115 -nb do not look for broken rhythms
116
117 -nt do not look for triplets
118
119 -obpl Print only one bar per line instead of 4. For complex music this
120 improves the readability and avoids some problems with some abc
121 to postscript converters. This option is deprecated.
122
123 -nogr (No note grouping.) Inserts a space between all notes. It makes
124 a less pretty postscript file but it is easier to edit.
125
126 -bpl nbars
127 Print nbars of music on every line followed by a backslash.
128
129 -bps nbars
130 When nbars have been printed (including those lines joined by a
131 backslash continuation) go to a new line (with no backslash).
132
133 -splitvoices
134 This parameter handles polyphonic chords by splitting an entire
135 voice into multiple voices. (A polyphonic chord is a chord com‐
136 posed of notes that do not start or end at the same time.) Nor‐
137 mally, midi2abc joins the longer notes to the notes in the fol‐
138 lowing chord using ties. Here is an example: [Bd-]d [Bd-]d|.
139 This should be separated into two voices ideally Bz Bz and d2
140 d2. However, the separation is not unique. Bz d2 and d2 Bz are
141 also ok.
142
143 -midigram
144 When this option appears, all other options are ignored and no
145 abc file is produced. Instead a list of all notes in the MIDI
146 file are printed in a fixed format. Each line represents a pair
147 of MIDI note on/off event. The line contains the on/off time of
148 the note, its track number, channel number, midi pitch and midi
149 velocity. The last record indicates the duration of the MIDI
150 file in MIDI pulse units. The output is designed to go into a
151 graphical user interface which will produce a graphical repre‐
152 sentation (piano roll).
153
154 -mftext
155 When this option appears, all other options are ignored and no
156 abc file is produced. Instead a list of all the MIDI commands
157 are printed. The output is designed to go into a graphical user
158 interface provided by runabc.tcl.
159
160 -mftextpulses
161 Same as -mftext except the time units is in midi pulses.
162
163 -title string
164 Replaces the default title field following T: with the given
165 string.
166
167 -origin string
168 Adds an O: field with the given string.
169
170 -stats Extracts the characteristics of the given midi file. They
171 include ntrks - the number of tracks, ppqn - pulses per quarter
172 note, timesig - time signature, keysig - key signature, program
173 - mapping between channel number and midi program, npulses -
174 length of the midi file in pulses, tempocmd - number of times
175 the tempo has been specified, pitchbends - number of pitchbends,
176 pitchbendin - number of pitchbends in each of the channels, pro‐
177 gramcmd - number of times the midi program has been revised,
178 progs and progsact - the programs used and the number of pulses
179 these programs used, drums - the drum numbers that were used,
180 drumhits - the number of times each of those drums were hit,
181 pitches - the number of times the 11 pitch classes (C C# etc...)
182 were activated and a few other complex variables. These charac‐
183 teristics are used in other applications such as midiexplorer.
184 More details are available in the file midi2abc-stats.txt
185 included in the doc/ folder of the abcmidi distribution package.
186
187
188
189 FEATURES
190 * The key is chosen so as to minimize the number of accidentals.
191 Alternatively, the user can specify the key numerically (a positive
192 number is the number of sharps, a negative number is minus the number
193 of flats).
194
195 * Note length can be set by specifying the total number of bars or the
196 tempo of the piece. Alternatively the note length can be read from the
197 file. However, by default it is deduced in a heuristic manner from the
198 inter-note distances. This means that you do not have to use the MIDI
199 clock as a metronome when playing in a tune from a keyboard.
200
201 * Barlines are automatically inserted. The user specifies the number of
202 measures in the anacrusis before the first barline and the time signa‐
203 ture.
204
205 * The program can guess how the length of the anacrusis, either by
206 looking for the first strong note or minimizing the number of notes
207 split by a tie across a barline.
208
209 * Where a note extends beyond a bar break, it is split into two tied
210 notes.
211
212 * The output has 4 bars per line.
213
214 * Enough accidental signs are put in the music to ensure that no pitch
215 errors occur if a barline is added or deleted.
216
217 * The program attempts to group notes sensibly in each bar.
218
219 * Triplets and broken rhythm (a>b) are supported.
220
221 * Chords are identified.
222
223 * Text information from the original MIDI file is included as comments.
224
225 * The -c option can be used to select only 1 MIDI channel. Events on
226 other channels are ignored.
227
228 LIMITATIONS
229 midi2abc does not ...
230
231 * Supply tune title, composer or any other field apart from X: , K:,
232 Q:, M: and L: - these must be added by hand afterwards, though they may
233 have been included in the text of the MIDI file.
234
235 * Support duplets, quadruplets, other esoteric features.
236
237 * Support mid-tune key or time signature changes.
238
239 * Deduce repeats. The output is just the notes in the input file.
240
241 * Recover an abc tune as supplied to abc2midi. However, if you want to
242 do this, "midi2abc -xa -f file.mid" comes close.
243
245 abc2ps(1), abc2midi(1), abc2abc(1)
246
248 James Allwright <J.R.Allwright@westminster.ac.uk>
249
251 Seymour Shlien <fy733@ncf.ca>
252
254 This man page describes midi2abc version 2.91 from March 09 2008.
255
257 Copyright 1999 James Allwright
258
259 midi2abc does not work correctly if lyrics are embedded in the same
260 track as the notes. If you are producing the MIDI file using abc2midi,
261 use the -STFW option to ensure that the lyrics are put in a separate
262 track.
263
264 midi2abc is supplied "as is" without any warranty. It is free software
265 and can be used, copied, modified and distributed without fee under the
266 terms of the GNU General Public License.
267
268
269
270
271 1 January 2017 MIDI2ABC(1)