MAN page from Mandrake 10.X abcMIDI-2004_06_12-2.mdk10.1.thac.i586.rpm


Section: User Commands (1)
Updated: 12 June 2004


abc2midi - converts abc file to MIDI file(s) 


abc2midi infile [refnum] [-c] [-v] [-t] [-n limit] [-RS] [-NAR] [-o outfile] 


 The default action is to write a MIDI file for each abc tune
 with the filename <stem>N.mid, where <stem> is the filestem
 of the abc file and N is the tune reference number. If the -o
 option is used, only one file is written. This is the tune
 specified by the reference number or, if no reference number
 is given, the first tune in the file. 


process the tune with reference number refnum
selects checking only
selects verbose option
selects filenames derived from tune titles
use 3:1 instead of 2:1 for broken rhythms
Suppresses the warning 'Assuming repeat'
-n X
limits the length of the file name stem to X characters
-o outfile
write output to outfile


* Broken rythms (>, <), chords, n-tuples, slurring, ties, staccatto notes,repeats, in-tune tempo/length/time signature changes are all supported.

* R:hornpipe or r:hornpipe is recognized and note timings are adjusted togive a broken rhythm (ab is converted to a>b).

* Most errors in the abc input will generate a suitable error message inthe output and the converter keeps going.

* Comments and text fields in the abc source are converted to text eventsin the MIDI output

* If guitar chords are present, they are used to generate an accompanimentin the MIDI output.

* If there are mis-matched repeat signs in the abc, the program attempts tofix them. However, it will not attempt this if a multi-part tune description has been used or if multiple voices are in use.

* Karaoke MIDI files can be generated by using the w: field to include lyrics.

* Nonnumeric voice id's, eg. V: soprano, as proposed for the newabc standard is accepted.

* Invisible rests specified by x are treated the same way asnormal rests (z).



* No field is inherited from above the X: field of the tune. 


* There are some extensions to the abc syntax of the form

%%MIDI channel n

These control channel and program selection, transposing and variousother features of abc2midi.

Each of these should appear on a line by itself. All of them are allowedwithin the abc tune body. By using these in combination with the partnotation, one can, for example, play a part transposed or in a different key.

The idea behind this syntax is that other programs will treat it as acomment and ignore it.

%%MIDI channel n

selects melody channel n (in the range 1-16).

%%MIDI program [c] n

selects program n (in the range 1-128) on channel c. If c is not given, theprogram is selected on the current melody channel. Most modern tonegenerators follow the General MIDI standard which defines the instrumenttype for each program number.

%%MIDI beat a b c n

controls the way note velocities are selected. The first note in a bar hasvelocity a. Other "strong" notes have velocity b and all the rest have velocityc. a, b and c must be in the range 0-128. The parameter n determines whichnotes are "strong". If the time signature is x/y, then each note is givena position number k = 0, 1, 2 .. x-1 within each bar. Note that the units forn are not the unit note length. If k is a multiple of n, then the note is"strong". The volume specifiers !ppp! to !fff! are equivalent to thefollowing :!ppp! = %%MIDI beat 30 20 10 1
!pp! = %%MIDI beat 45 35 20 1
!p! = %%MIDI beat 60 50 35 1
!mp! = %%MIDI beat 75 65 50 1
!mf! = %%MIDI beat 90 80 65 1
!f! = %%MIDI beat 105 95 80 1
!ff! = %%MIDI beat 120 110 95 1
!fff! = %%MIDI beat 127 125 110 1

%%MIDI beatstring <string of f, m and p>

This provides an alternative way of specifying where the strong and weakstresses fall within a bar. 'f' means velocity a (normally strong), 'm'means velocity b (medium velocity) and 'p' means velocity c (soft velocity).For example, if the time signature is 7/8 with stresses on the first, fourthand sixth notes in the bar, we could use the following

%%MIDI beatstring fppmpmp

%%MIDI transpose n

transposes the output by the specified number of semitones. n may bepositive or negative.

%%MIDI rtranspose n

Relative transpose by the specified number of semitones. i.e.%%MIDI transpose a followed by %%MIDI rtranspose b results in atransposition of a+b. %%MIDI transpose b will result in a transpositionof b semitones, regardless of any previous transposition.

%%MIDI c n

specifies the MIDI pitch which corresponds to c. The default is 60. Thisnumber should normally be a multiple of 12.

%%MIDI grace a/b

sets the fraction of the next note that grace notes will take up. amust be between 1 and b-1. The grace notes may not sound naturalin this approach, since the length of the individual grace notesvary with the complexity of the grace and the length of thefollowing note. A different approach (which is now the default)assumes that the grace notes always have a fixed duration.To use the other approach you would specify,%%MIDI gracedivider bwhere b specifies how many parts to divide the unit lengthspecified by the L: field command. For example if b = 4 andL: = 1/8, then every grace note would be 1/(8*4) or a 32ndnote. Time would be stolen from the note to which the gracenotes are applied. If that note is not long enough to handlethe grace then the grace notes would be assigned 0 duration.

%%MIDI chordname name n1 n2 n3 n4 n5 n6

Defines how to play a guitar chord called "name". n1 is usually 0 andn2, n3 to n6 give the pitches of the other notes in semitones relativeto the root note. There may be fewer than 6 notes in the chord, but notmore.If "name" is already defined, this command re-defines it. Unlikemost other commands, chordname definitions stay in effect from where theyare defined to the end of the abc file. The following illustrates howm, 7, m7 and maj7 could be set up if they were not already defined.

%%MIDI chordname m 0 3 7
%%MIDI chordname 7 0 4 7 10
%%MIDI chordname m7 0 3 7 10
%%MIDI chordname maj7 0 4 7 11

%%MIDI gchord string

sets up how guitar chords are generated. The string is a sequence made ofof z's, c's f's and b's for rests, chords, fundamental and fundamentalplus chord notes respectively. This specifies how each bar is to be played.An optional length is allowed to follow the z's, c's f's and b's e.g. czf2zf3.If the abc contains guitar chords, then abc2midi automatically adds chords andfundamentals after encountering the first guitar chord. It keeps using thatchord until a new chord is specified in the abc. Whenever the M: field isencountered in the abc, an appropriate default string is set :For 2/4 or 4/4 time default is equivalent to :%%MIDI gchord fzczfzczFor 3/4 time default is equivalent to :%%MIDI gchord fzczczFor 6/8 time default is equivalent to :%%MIDI gchord fzcfzcFor 9/8 time default is equivalent to :%%MIDI gchord fzcfzcfzcThe gchord command has been extended to allow you to playthe individual notes comprising the guitar chord. This allowsyou to play broken chords or arpeggios. The new codes g,h,i,j,G,H,I,J reference the individual notes starting from thelowest note of the chord (not necessarily the root in thecase of inversions). For example for the C major chord, grefers to C, h refers to E and i refers to G. For a gchordcommand such as,%%MIDI gchord ghihAbc2midi will arpeggiate the C major guitar chord toCEGE. The upper case letters G,H,I, and J refer tothe same notes except they are transposed down oneoctave. Note for the first inversion of the C majorchord (indicated by "C/E"), E would be the lowestnote so g would reference the note E.Like other gchord codes, you may append a numeral indicatingthe duration of the note. The same rules apply as before.You can use any combination of the gchord codes,(fcbghijGHIJz).

%%MIDI chordprog n

Sets the MIDI instrument for the chords to be n.

%%MIDI bassprog n

Sets the MIDI instrument for the bass notes to be n.

%%MIDI chordvol n

Sets the volume (velocity) of the chord notes at n.

%%MIDI bassvol n

Sets the volume (velocity) of the bass notes at n. There is no correspondingmelodyvol command since there are 3 velocity values for melody, set using thebeat command.

%%MIDI gchordon

Turns on guitar chords (they are turned on by default at the start of atune).

%%MIDI gchordoff

Turns off guitar chords.

%%MIDI droneon

Turns on a continuous drone (used in bagpipe music) consistingof two notes. By default the notes are A, and A,, playedon a bassoon at a velocity of 80. This can be configuredby the %%MIDI drone command described below.

%%MIDI droneoff

Turns off the continous drone.

%%MIDI drone n1 n2 n3 n4 n5

Sets the drone parameters where n1 is the MIDI program, n2 andn3 specify the MIDI pitches of the two notes in the chord, and n4 and n5 specify the MIDI velocities of the two notes.If you do not set these parameters they are by default70 45 33 80 80. A value of zero or less indicates thatthe setting of this parameter should be left as it is.

%%MIDI drum string [drum programs] [drum velocities]

This sets up a drum pattern. The string determines when there is a drum beatand the drum program values determine what each drum strike sounds like.

e.g. %%MIDI drum d2zdd 35 38 38 100 50 50

The string may contain 'd' for a drum strike or 'z' for a rest. By defaulta voice starts with no drum pattern and '%%MIDI drumon' is needed to enable the drumming. The drum pattern is repeated duringeach bar until '%%MIDI drumoff' is encountered. The %%MIDI drum command may be used within a tune to change the drum pattern. This command places the drum sounds on channel 10 andassumes your tone generator complies with the General Midi standard - ifit does not, then you may hear tones instead of drum sounds.

In both the gchord and drum commands, the standard note length ofa single note f,c,z or d is not set by the L: command. Instead itis adjusted so that the entire gchord string or drum string fitsexactly into one bar. In other words the duration of each noteis divided by the total duration of the string. This means that,for example, the drum string "dd" is equivalent to drum string "d4d4".You cannot currently specify fractions directly (eg. C3/2)as done in the body of the music, but it is still possible to expresscomplex rhythms. For example, to indicate a rhythm such as(3ddd d/d/d/d, you would write the string "d4d4d4d3d3d3d3". 


The proposed standard introduces a new copyright fieldusing the syntax

%%abc-copyright (c) Copyright John Smith 2003

Abc2midi now inserts this in the MIDI file in the form of ametatext copyright tag. Changes were made to the event_specificfunction in store.c to process the copyright information. Itis also copied into the Karaoke track (if it is created) asas @T field.



abc2ps(1), midi2abc(1), yaps(1). 


James Allwright <> 


 by Seymour Shlien <> 


This man page describes abc2midi version 1.44, June 12 2004. 


Copyright 1999 James Allwright

abc2midi is supplied "as is" without any warranty. Itis free software and can be used, copied, modified anddistributed without fee under the terms of the GNU General Public License.

More complete documentation may be found in abcguide.txtwhich comes with the abcMIDI distribution.




This document was created byman2html,using the manual pages.