Introduction to abcMIDI
David Montenegro
Seacoast Linux Users Group
What is abcMIDI?
- a set of utilities for processing ABC music
- part of the ABC Music project http://abc.sourceforge.net/
- tools for typsetting ABC music, converting ABC music to MIDI,
creating ABC music from MIDI, and manipulating ABC music files
- developed by James Allwright
- currently maintained by Seymour Shlien (seymour dot shlien at crc dot ca)
What is MIDI?
- Musical Instrument Digital Interface ("MIDI")
- industry standard defined in 1982
- enables electronic musical instruments to communicate with other electronic equipment
- physical interface: DIN 5/180° connectors
- communications protocol: MIDI messages
- file format: Standard MIDI File ("SMF") .MID
- General MIDI Level 1 ("GM") defines specific instruments for each MIDI "Program Number"
What is ABC?
ABC is:
- a format for musical notation as plain text
- developed by Chris Walshaw
- introduced at the end of 1991
Common uses of ABC:
- creating printed sheet music
- generating MIDI for playback/performance
- storing collections of music in tune databases
- Example: JC's ABC Tune Finder
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
- Notes are represented by capital or lower case letters A-G,
possibly followed by an octave suffix.
- Notes below C5 are represented using capital letters.
- Notes at or above C5 are represented using lower case letters.
- A "," suffix indicates a note one octave lower.
- A "'" suffix indicates a note one octave higher.
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.
| Prefix | Meaning |
| ^ | 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.
- Integers indicate multiples of the default note length.
Examples: E2 c3 A,4
- A "/" followed by a power of two indicates a fraction of the
default note length.
Examples: a/2 e'/4 b/8
- Omission of a duration suffix indicates the default note length
(specified by the header).
Examples: a' E c A,
The ABC Music "standard"
- official Version 1.6
- draft Version 2.0
- term "standard" used loosely
- syntax not fully specified
- semantics largely unspecified
- the words "must", "mandatory", and "require*" appear nowhere in the official specification
- the draft standard (2.0) is more thorough
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
- David Montenegro
P.O. Box 763
Farmington, NH 03835
- VirginSnow@vfemail.net