1ABC2MIDI(1) General Commands Manual ABC2MIDI(1)
2
3
4
6 abc2midi - converts abc file to MIDI file(s)
7
9 abc2midi infile [refnum] [-c] [-v] [-ver] [-t] [-n limit] [-RS]
10 [-quiet] [-Q tempo] [-NFNP] [-OCC] [-NCOM] [-o outfile]
11
13 The default action is to write a MIDI file for each abc tune
14 with the filename <stem>N.mid, where <stem> is the filestem
15 of the abc file and N is the tune reference number. If the -o
16 option is used, only one file is written. This is the tune
17 specified by the reference number or, if no reference number
18 is given, the first tune in the file.
19
21 refnum process the tune with reference number refnum
22
23 -c selects checking only
24
25 -v selects verbose option
26
27 -ver prints version number and exits
28
29 -t selects filenames derived from tune titles
30
31 -RS use 3:1 instead of 2:1 for broken rhythms
32
33 -quiet Suppresses some commong warnings.
34
35 -n X limits the length of the file name stem to X characters
36
37 -Q tempo
38 sets the default tempo in quarter notes per minute if it was not
39 specified in the abc header.
40
41 -NFNP Ignore any dynamic indications !f! !ff! etc.
42
43 -NCOM Suppress some comments in the output MIDI file.
44
45 -OCC Accept old chord convention (eg +D2G2+ instead of [DG]2).
46
47 -o outfile
48 write output to outfile
49
51 * Broken rythms (>, <), chords, n-tuples, slurring, ties, staccatto
52 notes, repeats, in-tune tempo/length/time signature changes are all
53 supported.
54
55 * R:hornpipe or r:hornpipe is recognized and note timings are adjusted
56 to give a broken rhythm (ab is converted to a>b).
57
58 * Most errors in the abc input will generate a suitable error message
59 in the output and the converter keeps going.
60
61 * Comments and text fields in the abc source are converted to text
62 events in the MIDI output
63
64 * If guitar chords are present, they are used to generate an accompani‐
65 ment in the MIDI output.
66
67 * If there are mis-matched repeat signs in the abc, the program
68 attempts to fix them. However, it will not attempt this if a multi-part
69 tune description has been used or if multiple voices are in use.
70
71 * Karaoke MIDI files can be generated by using the w: field to include
72 lyrics.
73
74 * Nonnumeric voice id's, eg. V: soprano, as proposed for the new abc
75 standard is accepted.
76
77 * Invisible rests specified by x are treated the same way as normal
78 rests (z).
79
80 * Decorations may be indicated using either the deprecated notation
81 (eg. !fermata!) or the standard version 2.0 notation (eg. +fermata+).
82
84 * No field is inherited from above the X: field of the tune.
85
86
87
89 * There are some extensions to the abc syntax of the form
90
91 %%MIDI channel n
92
93 These control channel and program selection, transposing and various
94 other features of abc2midi.
95
96 Each of these should appear on a line by itself. All of them are
97 allowed within the abc tune body. By using these in combination with
98 the part notation, one can, for example, play a part transposed or in a
99 different key.
100
101 The idea behind this syntax is that other programs will treat it as a
102 comment and ignore it.
103
104 %%MIDI channel n
105
106 selects melody channel n (in the range 1-16).
107
108 %%MIDI program [c] n
109
110 selects program n (in the range 1-128) on channel c. If c is not given,
111 the program is selected on the current melody channel. Most modern tone
112 generators follow the General MIDI standard which defines the instru‐
113 ment type for each program number.
114
115 %%MIDI beat a b c n
116
117 controls the way note velocities are selected. The first note in a bar
118 has velocity a. Other "strong" notes have velocity b and all the rest
119 have velocity c. a, b and c must be in the range 0-128. The parameter n
120 determines which notes are "strong". If the time signature is x/y, then
121 each note is given a position number k = 0, 1, 2 .. x-1 within each
122 bar. Note that the units for n are not the unit note length. If k is a
123 multiple of n, then the note is "strong". The volume specifiers !ppp!
124 to !fff! are equivalent to the following :
125
126 !ppp! = %%MIDI beat 30 20 10 1
127 !pp! = %%MIDI beat 45 35 20 1
128 !p! = %%MIDI beat 60 50 35 1
129 !mp! = %%MIDI beat 75 65 50 1
130 !mf! = %%MIDI beat 90 80 65 1
131 !f! = %%MIDI beat 105 95 80 1
132 !ff! = %%MIDI beat 120 110 95 1
133 !fff! = %%MIDI beat 127 125 110 1
134
135
136 %%MIDI beatmod n
137
138 Increments by n (or decrements if n is negative) the velocities a, b
139 and c described above. The instructions !crescendo(! and !crescendo)!
140 are equivalent to inserting a %%MIDI beatmod 15 whereever they occur.
141 (Alternatively you can use !<(! and !<)!.) Similarly the instructions
142 !diminuendo(! and !diminuendo)! are equivalent to %%MIDI beatmod -15.
143
144
145 %%MIDI deltaloudness n
146
147 where n is a small positive number. By default the crescendo and
148 diminuendo instructions modify the beat variables a, b, and c by 15
149 velocity units. This instruction allows you to set this default to
150 value n.
151
152
153 %%MIDI nobeataccents
154
155 For instruments such as church organ that have no greatly emphasized
156 beat notes, using this will force use of the 'b' velocity (see %%MIDI
157 beat) for every note irrespective of position in the bar. This allows
158 dynamics (ff, f, etc) to be used in the normal way.
159
160 %%MIDI beataccents
161
162 Revert to emphasizing notes the the usual way. (default)
163
164
165 %%MIDI beatstring <string of f, m and p>
166
167 This provides an alternative way of specifying where the strong and
168 weak stresses fall within a bar. 'f' means velocity a (normally
169 strong), 'm' means velocity b (medium velocity) and 'p' means velocity
170 c (soft velocity). For example, if the time signature is 7/8 with
171 stresses on the first, fourth and sixth notes in the bar, we could use
172 the following
173
174 %%MIDI beatstring fppmpmp
175
176 %%MIDI transpose n
177
178 transposes the output by the specified number of semitones. n may be
179 positive or negative.
180
181 %%MIDI rtranspose n
182
183 Relative transpose by the specified number of semitones. i.e. %%MIDI
184 transpose a followed by %%MIDI rtranspose b results in a transposition
185 of a+b. %%MIDI transpose b will result in a transposition of b semi‐
186 tones, regardless of any previous transposition.
187
188 %%MIDI c n
189
190 specifies the MIDI pitch which corresponds to c. The default is 60.
191 This number should normally be a multiple of 12.
192
193 %%MIDI grace a/b
194
195 sets the fraction of the next note that grace notes will take up. a
196 must be between 1 and b-1. The grace notes may not sound natural in
197 this approach, since the length of the individual grace notes vary with
198 the complexity of the grace and the length of the following note. A
199 different approach (which is now the default) assumes that the grace
200 notes always have a fixed duration. To use the other approach you
201 would specify,
202
203 %%MIDI gracedivider b
204
205 where b specifies how many parts to divide the unit length specified by
206 the L: field command. For example if b = 4 and L: = 1/8, then every
207 grace note would be 1/(8*4) or a 32nd note. Time would be stolen from
208 the note to which the grace notes are applied. If that note is not long
209 enough to handle the grace then the grace notes would be assigned 0
210 duration.
211
212
213
214
215 %%MIDI chordname name n1 n2 n3 n4 n5 n6
216
217 Defines how to play a guitar chord called "name". n1 is usually 0 and
218 n2, n3 to n6 give the pitches of the other notes in semitones relative
219 to the root note. There may be fewer than 6 notes in the chord, but not
220 more.If "name" is already defined, this command re-defines it. Unlike
221 most other commands, chordname definitions stay in effect from where
222 they are defined to the end of the abc file. The following illustrates
223 how m, 7, m7 and maj7 could be set up if they were not already defined.
224
225 %%MIDI chordname m 0 3 7
226 %%MIDI chordname 7 0 4 7 10
227 %%MIDI chordname m7 0 3 7 10
228 %%MIDI chordname maj7 0 4 7 11
229
230 %%MIDI gchord string
231
232 sets up how guitar chords are generated. The string is a sequence made
233 of of z's, c's f's and b's for rests, chords, fundamental and funda‐
234 mental plus chord notes respectively. This specifies how each bar is
235 to be played. An optional length is allowed to follow the z's, c's f's
236 and b's e.g. czf2zf3. If the abc contains guitar chords, then
237 abc2midi automatically adds chords and fundamentals after encountering
238 the first guitar chord. It keeps using that chord until a new chord is
239 specified in the abc. Whenever the M: field is encountered in the abc,
240 an appropriate default string is set :
241
242 For 2/4 or 4/4 time default is equivalent to : %%MIDI gchord fzczfzcz
243
244 For 3/4 time default is equivalent to : %%MIDI gchord fzczcz
245
246 For 6/8 time default is equivalent to : %%MIDI gchord fzcfzc
247
248 For 9/8 time default is equivalent to : %%MIDI gchord fzcfzcfzc
249
250 The gchord command has been extended to allow you to play the individ‐
251 ual notes comprising the guitar chord. This allows you to play broken
252 chords or arpeggios. The new codes g,h,i,j, G,H,I,J reference the indi‐
253 vidual notes starting from the lowest note of the chord (not necessar‐
254 ily the root in the case of inversions). For example for the C major
255 chord, g refers to C, h refers to E and i refers to G. For a gchord
256 command such as,
257
258 %%MIDI gchord ghih
259
260 Abc2midi will arpeggiate the C major guitar chord to CEGE. The upper
261 case letters G,H,I, and J refer to the same notes except they are
262 transposed down one octave. Note for the first inversion of the C major
263 chord (indicated by "C/E"), E would be the lowest note so g would ref‐
264 erence the note E.
265
266 Like other gchord codes, you may append a numeral indicating the dura‐
267 tion of the note. The same rules apply as before. You can use any com‐
268 bination of the gchord codes, (fcbghijGHIJz).
269
270
271
272 %%MIDI chordprog n
273
274 Sets the MIDI instrument for the chords to be n.
275
276 %%MIDI bassprog n
277
278 Sets the MIDI instrument for the bass notes to be n.
279
280 %%MIDI chordvol n
281
282 Sets the volume (velocity) of the chord notes at n.
283
284 %%MIDI bassvol n
285
286 Sets the volume (velocity) of the bass notes at n. There is no corre‐
287 sponding melodyvol command since there are 3 velocity values for
288 melody, set using the beat command.
289
290 %%MIDI gchordon
291
292 Turns on guitar chords (they are turned on by default at the start of a
293 tune).
294
295 %%MIDI gchordoff
296
297 Turns off guitar chords.
298
299 %%MIDI droneon
300
301 Turns on a continuous drone (used in bagpipe music) consisting of two
302 notes. By default the notes are A, and A,, played on a bassoon at a
303 velocity of 80. This can be configured by the %%MIDI drone command
304 described below.
305
306 %%MIDI droneoff
307
308 Turns off the continous drone.
309
310 %%MIDI drone n1 n2 n3 n4 n5
311
312 Sets the drone parameters where n1 is the MIDI program, n2 and n3 spec‐
313 ify the MIDI pitches of the two notes in the chord, and n4 and n5 spec‐
314 ify the MIDI velocities of the two notes. If you do not set these
315 parameters they are by default 70 45 33 80 80. A value of zero or less
316 indicates that the setting of this parameter should be left as it is.
317
318 %%MIDI drum string [drum programs] [drum velocities]
319
320 This sets up a drum pattern. The string determines when there is a drum
321 beat and the drum program values determine what each drum strike sounds
322 like.
323
324 e.g. %%MIDI drum d2zdd 35 38 38 100 50 50
325
326 The string may contain 'd' for a drum strike or 'z' for a rest. By
327 default a voice starts with no drum pattern and '%%MIDI drumon' is
328 needed to enable the drumming. The drum pattern is repeated during each
329 bar until '%%MIDI drumoff' is encountered. The %%MIDI drum command may
330 be used within a tune to change the drum pattern. This command places
331 the drum sounds on channel 10 and assumes your tone generator complies
332 with the General Midi standard - if it does not, then you may hear
333 tones instead of drum sounds.
334
335 In both the gchord and drum commands, the standard note length of a
336 single note f,c,z or d is not set by the L: command. Instead it is
337 adjusted so that the entire gchord string or drum string fits exactly
338 into one bar. In other words the duration of each note is divided by
339 the total duration of the string. This means that, for example, the
340 drum string "dd" is equivalent to drum string "d4d4". You cannot cur‐
341 rently specify fractions directly (eg. C3/2) as done in the body of the
342 music, but it is still possible to express complex rhythms. For exam‐
343 ple, to indicate a rhythm such as (3ddd d/d/d/d, you would write the
344 string "d4d4d4d3d3d3d3".
345
346 %%MIDI drumbars n
347
348 The %%MIDI drum line can sound quite monotonous if it is repeated each
349 bar. To circumvent this problem a new MIDI command %%MIDI drumbars n
350 where n is a small number will spread out the drum string over n con‐
351 secutive bars. By default drumbars is set to 1 maintaining compatibil‐
352 ity with existing abc files. You should take care that the drumstring
353 is evenly divisible between the drumbar bars. Also the time signature
354 should not change between bars in a drumbar unit. (Sample abc file in
355 doc/CHANGES June 24 2008.)
356
357 %%MIDI gchordbars n
358
359 This command spreads the gchord string over n consecutive bars just
360 like drumbars (above). (A sample is found in doc/CHANGES March 17
361 2009.)
362
363
364
365
366
367 With version 1.54 Dec 4 2004 of abc2midi, notes in chords (eg. [FAc])
368 are not played in the same instant but offsetted and shortened by 10
369 MIDI time units. Thus the first note in the chord (eg. F) is played for
370 the full indicated time, the second note (eg. A) starts 10 MIDI units
371 later and is shortened by the same amount and the third note starts
372 another 10 MIDI units later and is shortened by another 10 units. This
373 introduces an "expressivo" option and avoids the heavy attack. (This
374 does not apply to gchords or multivoiced chords.) The amount of the
375 delay and shortening may be configured by the MIDI command
376
377
378 %%MIDI chordattack n
379
380
381 where n is a small number. If n is zero, then abc2midi should behave as
382 in earlier versions. The delay n is in MIDI time units where there are
383 480 units in a quarter note beat. The program may not run correctly if
384 n is too large and there are short chords.
385
386
387 %%MIDI randomchordattack n
388
389 Like above except that the delay is a random variable uniformly dis‐
390 tributed between 0 and n-1.
391
392
393 %%MIDI trim x/y
394
395 where x and y are two numbers. This command controls the articulation
396 of notes and chords by placing silent gaps between the notes. The
397 length of these gaps is determined by x/y and the unit length specified
398 by the L: command. These gaps are produced by shortening the notes by
399 the same amount. If the note is already shorter than the specified
400 gap, then the gap is set to half the length of the note. The fraction
401 x/y indicates a note duration in the same manner as specified in the
402 abc file. The actual duration is based on the unit length specified by
403 the L: field command. It is recommended that x/y be a fraction close to
404 zero. Note trimming is disabled inside slurs as specified by parenthe‐
405 ses. You can turn off all note trimming by setting x to 0, eg 0/1. By
406 default, note trimming is turned off at the beginning of a tune or
407 voice command.
408
409
410
411 %%MIDI drummap note midipitch
412
413 Please see abcguide.txt.
414
415
416
418 The proposed standard introduces a new copyright field using the syntax
419
420
421 %%abc-copyright (c) Copyright John Smith 2003
422
423
424 Abc2midi now inserts this in the MIDI file in the form of a metatext
425 copyright tag. Changes were made to the event_specific function in
426 store.c to process the copyright information. It is also copied into
427 the Karaoke track (if it is created) as as @T field.
428
429
431 abc2ps(1), midi2abc(1), yaps(1).
432
434 James Allwright <J.R.Allwright@westminster.ac.uk>
435
437 by Seymour Shlien <seymour.shlien@crc.ca>
438
440 This man page describes abc2midi version 1.85 June 25 2006.
441
443 Copyright 1999 James Allwright
444
445 abc2midi is supplied "as is" without any warranty. It is free software
446 and can be used, copied, modified and distributed without fee under the
447 terms of the GNU General Public License.
448
449 More complete documentation may be found in abcguide.txt which comes
450 with the abcMIDI distribution.
451
452
453
454 25 June 2006 ABC2MIDI(1)