Tag Archives: ABC

ABC For Blind Musicians

ABC is one of the oldest, most popular, and best supported text-based music notation languages around.  It is quite possible for blind musicians to create scores in ABC using an ordinary text editor and have them rendered in standard notation and played via MIDI just as one might do with full-fledged notation software.

Information on ABC

Here are some links with more information about ABC itself:

  • ABC Notation – this is the official home of ABC
  • ABC Plus – this site has much useful information on ABC and the various tools available, including the best documentation on the language that I have seen.  That document, entitled Making Music with ABC Plus, is provided as a PDF within a ZIP file (along with some demonstration files).

I can get you started in just a couple of minutes, though.  A tune in ABC starts off with a few lines called the header, followed by the actual notes.  The header looks like this:

X:1
M:4/4
K:Eb

The first line X:1 is how software recognizes this is the start of an ABC file.  You can use any number you want, and in fact you can have several different tunes in one file, each starting with X: and a number.  The M: line specifies a meter (time signature) of 4/4, and the K: line specifies a key signature of E flat.  You can also add a line starting with T: to specify a title, with C: to specify the composer, Q: to specify tempo, etc. Just be sure to have the K: field last in the header.

Note that ABC is very case sensitive. The header fields listed above are all upper case letter followed by colons. ABC is also very sensitive to blank lines and somewhat sensitive to spaces. Blank lines are used to end a tune, so you can have several tunes in one file. Spaces can generally be included anywhere, but spaces between individual notes are used to control beaming, so be careful.

With the header out of the way, you can start typing your notes.  A note is typed as a pitch followed by a duration as follows:

For pitch, use upper case letters for the octave from middle C up, lower case letter for the octave above that.  Append apostrophes for octaves higher than that (as in f’ for the F on the top line of the treble clef staff), or commas for octaves lower than middle C (as in A, for the A two ledger lines below the treble clef staff).  You can precede a letter with an underscore for a flat (as in _D for D flat) or with a carat for a sharp (as in ^F for F sharp).  But you only need to do this for accidentals – when the flat or sharp is not in the key signature.  Oh, and an equal sign is a natural, (as in =B for a B natural, when in a key where it would normally be flat).  A lower case z is a rest.

For duration, a pitch by itself (as in C) is an eighth note.  Follow the pitch with a 2 (as in C2) for a quarter note, since a quarter note is two eighths long.  Similarly, C4 for a half note, C6 for a dotted half, etc.  Tie notes using a dash, (as in D4 – D for a half note tied to an eighth).

The last thing you need to know in order to make your first song is how to make bar lines.  A vertical bar character makes a bar line, two of them in a row makes a double bar, and a vertical bar followed by a right bracket makes the special “ending” double bar. By default, most ABC programs will obey the line breaks in your input. So if you enter four measures then hit Enter/Return and start entering more music, those first four measures will appear as one line of standard notation, and then a new line will be started.

ABC supports a ton more than this – really, just about everything you can do in standard notation, you can do in ABC.  You can read the ABC Plus documentation for all the gory details.  But simple things really are as simple as I just described it, and the above is probably enough to get you through most melodic dictation exercises.

As an example of a full song in ABC, here is Mary Had A Little Lamb in the key of Bb:

X:1
T:Mary Had A Little Lamb
M:4/4
K:Bb
D2 C2 B,2 C2 | D2 D2 D4 | C2 C2 C4 | D2 F2 F4 |
D2 C2 B,2 C2  | D2 D2 D2 D2 | C2 C2 D2 C2 | B,8 |]

Using EasyABC

The tool of choice for working with ABC, at least among sighted users, is EasyABC.  This is a text editor with built-in support for various other utilities that can do interesting things with ABC files, such as convert to standard notation, play via MIDI, etc.  It actually displays your ABC as standard notation in a separate pane of the window as you type, not that this particular feature is of much use to blind musicians.  But the software does appear to be reasonably accessible – it works well with screenreaders and provides keyboard control for its most important functionality.

When you install EasyABC, it comes with everything you need except for ghostscript, which you need to install separately in order to get PDF export of scores if you do not have it already.  There is some additional setup you will probably want to perform before you start to use EasyABC.  There has some automatic typing assistance turned on that silently inserts barlines and does other things you probably don’t really want.  I would start by going to Settings / ABC typing assistance / Active and making sure it is turned off.  This setting is remembered, so you only need to do it once.

I say EasyABC seems to reasonably accessible, but it’s not necessarily obvious how it is laid out or to use it.  I imagine that’s true of a lot of programs – it helps to know what is going on.  So here’s some things to know to get started.

When you fire up EasyABC, your cursor is in an edit pane where you can start typing ABC.  An ABC file has to start with an “X” and a “K” field, so first thing you probably want to do is type:

X:1
M:4/4
K:C

(or whatever meter and key you want instead of 4/4 and C).  Then you can type the actual music.  As you type, the results are automatically fed to abcm2ps and converted to standard notation which is displayed in another pane.  There is a third pane that contains a list of your open files, and of the tunes defined in each (ABC lets you define multiple tunes per file).  If there is a way to transfer focus to either of those other panes via keyboard, I haven’t found it.  I think you can do what you need without that, though.

Pressing F6 will play the current score, but only if it is free from errors. If you press F6 and nothing happens (give it a couple of seconds as the playback often lags behind), then you probably have a syntax error somewhere

Everything else you need is accessed through menus.

When you want to generate a PDF of your score, use File / Export Selected / PDF (which exports the current score), but as mentioned this only works if you’ve previously installed and configured ghostscript.  Since the notation is being displayed automatically in another window, though, you may find for classroom use (such as melodic dictation exercises) you don’t need to bother generating PDF.

You can also export a score to MusicXML which can then be imported into Finale, Sibelius, MuseScore, Lime Aloud, etc.

One especially nice thing about ABC and how it works with EasyABC is that you can have several “tunes” per file, and as you navigate through them, EasyABC automatically keeps track of the current tune.  So you can put several exercises in one file, like this:

X:1
M:4/4
K:none
% This is a C major scale
C D E F G A B c |

X:2
M:4/4
K:none
% This is a G major scale
G A B c d e ^f g |

As you move your edit cursor through the file, only the current tune will be displaying on screen in standard notation.  So you can show your teacher your answers one at a time that way.  Also, if you hit F6 to hear the playback, that also plays back the current tune only.  So you don’t have to always hear your entire file.

Using ABCexplorer

If EasyABC ends up not being your style for whatever reason, there is at least one other all-in-one program you may wish to try, at least one Windows.  Like EasyABC, ABCexplorer is primarily a text editor but with built in support for the various tools that can work with ABC.  It requires you to set a couple of options before getting started, and even then it’s use model is a bit more complex than EasyABC, but it might be a better alternative for Windows users who for whatever reason have trouble with EasyABC.

For the initial setup, hit Enter/OK if necessary to get past the opening splash screen.  Then open the Options dialog – Alt+P.  The first tab is “Directories and files”.  You need to turn off the “Save a convivial name” option on that tap.  Then Ctrl+Enter a few times to reach the “Miscellaneous” tab.  There, turn on the “Select the first tune at file opening”, and you may also want to turn off the “Tip of the day” startup screen.

Once set up in this fashion, it is “fairly” accessible.  After opening the program, you can hit Ctrl+F to start a new file followed by Ctrl+N to start a new tune within that file.  At that point, you can start typing ABC.  ABCexplorer actually starts a tune for you, with the standard header already filled in (time signature 4/4, etc), so you will really start by browsing through what’s been filled in for you and editing it as necessary.  Then add your actual ABC to the end.  You can hear playback at any time via Ctrl+P.  It takes a while to start playback, and then it loops when done, so hit Ctrl+P again to stop playback.  You can also use Alt+Left and Alt+Right to control the tempo, and Alt+Up and Alt+Down to control volume.

When are done editing, you need to hit F5 to exit the editor (F5 again puts you back in the editor).  Once out of the editor, the rest of the menus become available, and they are pretty straightforward: File / Save, File / Export, etc.  After opening a file, you will need to hit F5 to actually edit it.  While navigating the main interface, Tab does not always go where you would want, and there are a number of controls that are probably not keyboard-accessible at all.  If you get lost in the interface, hitting F5 should usually return you to a good place: either in the editor, or take out of the editor and ready to access the menus so you can try again.  It’s definitely not ideal.  On the other hand, it does work, and I am extremely grateful to the developer for having added some accessible features specifically upon my request.