Introduction to abcMIDI

David Montenegro

Seacoast Linux Users Group

What is abcMIDI?

What is MIDI?

What is ABC?

ABC is:

Common uses of ABC:

Example ABC file

Mary Had a Little Lamb

X:1
T:Mary Had a Little Lamb
% comment lines start with "%"
M:4/4
L:1/4
K:C
 EDCD | EE E2 | DD D2 | EE E2 |
 EDCD | EE EC | DD ED | C2 z2 |]

According to the official ABC specification: If the file contains only one tune, "X" is optional. "X" immediately preceeds "T". All other fields follow "T". "K" should be the last header field.

Denoting pitch

ABC staff

						     d'
					       -c'- ----
					    b
				       -a- --- ---- ----
				      g
------------------------------------f-------------------
				  e
--------------------------------d-----------------------
			      c
----------------------------B---------------------------
			  A
------------------------G-------------------------------
		      F
--------------------E-----------------------------------
		  D
---- ---- ---- -C-
	   B,
---- -A,-
 G,
(from the official specification)

Denoting accidentals

Accidentals may be indicated by an optional prefix.

PrefixMeaning
^sharp
_flat
=natural
^^double sharp
__double flat

Examples: ^C _b =f ^c' ^A,

Denoting duration

The duration of a note is indicated by an optional suffix.

The ABC Music "standard"

abcMIDI component programs

yaps
typesets ABC music as PostScript
abc2midi
creates MIDI files from ABC files
midi2abc
converts MIDI to its approximate ABC representation
abc2abc
transposing ABC music, altering file format, otherwise manipulating ABC music

Typesetting ABC music

Mary Had a Little Lamb

$ yaps mary.abc -o mary.ps

Note: the input file name preceeds any options on the command line.

The result:

Converting ABC music to MIDI

Mary Had a Little Lamb

$ abc2midi mary.abc -o mary.mid

Note: the input file name preceeds any options on the command line.

The result: mary.mid

Transposing ABC music

Start with a simple phrase:

X:1
T:simple phrase to transpose
M:4/4
L:1/4
K:Cmaj
CEGE | CFAF |

$ abc2abc simple.abc -t 7 # filename preceeds options

The result:

X:1
T:simple phrase to transpose
M:4/4
L:1/4
K:Gmaj
GBdB | Gcec |

Note: The key ("K") is now G, as it should be.

Score before and after transposition

Before transposition:

After transposition:

Composing ABC music

ABC be written using any text editor.

X:1
T:Composition 1, Version 1.0 (abridged)
C:David Montenegro
H:Version 1.0 composed 2009-04-21, abridged for abcMIDI presentation
N:range suitable for a 6-hole ocarina
M:4/4
L:1/4
K:C
%%MIDI program 41
CEGE | CFAF | CEGF | EF D2 |
CEGE | CF/2G/2AF | CE/2F/2GF/2D/2 | ED C2 |
% traspose up a major fifth
GBdB | Gc/2d/2ec | GB/2c/2d/2c/2B/2A/2 | ^F/2B/2 E/2A/2 D2 |
GB/2c/2dB | Gc/2d/2e/2d/2c/2B/2 | GB/2c/2dB/2A/2 | BA G2 |
% mix and match
cdec | GB/2c/2dB | CE/2F/2G/2F/2E/2D/2 | B/2e/2 A/2d/2 G2 |
% original key
CE/2F/2GE | C/2E/2F/2G/2A/2G/2F/2E/2 | CE/2F/2GE/2D/2 | ED C2 |]

Example composition

Example MIDI: comp.mid

Contacting the Author