The purpose of this page is to help you to copy abc code for a tune and display it on a screen or print it out, preserving the formatting so it looks like the tunes in the PDF documents on this web site.
Important Note #1: If you don’t know much about how abc notation works, you might find this material easier to understand if you read the abc Musical Notation section. It explains the workings of the different parts of the abc document, and provides links to web sites with further information.
Important Note #2: This page works best on a screen at least 768 pixels wide. You should hold an iPhone or any other small screen in landscape orientation for best results.
In transcribing a tune we are concerned with two types of information: the actual tune (melody, chords, etc.), and how we want the resulting musical notation to look. This corresponds to the two parts of a tune in abc notation.
The Tune Body contains code for the music, and the Tune Header describes the important qualities of the tune (title, composer, meter, key, etc.). From this the abc reader software can generate standard musical notation for the tune, and it can play the tune. But the notation may not look like you want it to look. The fonts might not seem right, the margins may not be as you want, etc.
This is where the File Headers come in. File headers contain formatting commands (often Postscript commands) to specify aspects of the appearance of the tune notation: font and font size for the title, composer, chords and more. They may specify the size of the noteheads, space between staffs, margins, and nearly everything else you might want to format.
Here’s where we run into problems. Both the Document and Tune File Headers are part of an abc document but not part of any tune. These days one of the easiest ways to find a tune transcription is to use one of the abc search web sites (e.g. JC's Tune Finder or the search page of abc Home Page). But they only find the Tune Header and Tune Body. Because they aren’t part of any specific tune, the File Headers get lost. In addition to important formatting commands, these headers often contain information necessary for the tune to be processed correctly (e.g. abc version number, user-defined symbols).
It's pretty easy. The File Header is reproduced below. To copy a tune, do the following. I'll assume you're using EasyABC on a Mac, but the steps will be very similar for most modern abc software on a Mac or Windows computer.
That's it — you're done!
%abc-2.2 % Interpret abc code using abc standard version 2.2
I:abc-charset utf-8
% File Header (including top two lines). This includes information to be used
% in all the tunes (fonts, spacing, etc.)
% Note: If you take the abc code for a tune and omit this Header, many things will look
% very different.
% A single percent sign makes everything after it a comment, not used by the software.
% Two percent signs causes what's after it to be a postscript command.
% The following defines the fonts to be used in these tunes.
%%font Palatino
%%font Palatino-Roman
%%font Palatino-Bold
%%font Palatino-Italic
%%font Palatino-BoldItalic
%%font Courier
% Here we say how much space to use and other related stuff
%%pageheight 11in % with abc2svg, to control page breaks, margins
%%footer "$P" % Page number
%%shiftunison 0 % One note head for unison drones
%%topmargin 0in % Space at top of page
%%topspace .5in % Space above tune
%%composerspace 0.4cm
%%musicspace .4cm
%%staffsep 50pt % Separation between staffs
%%maxstaffsep 50pt % (minimum, maximum space allowed)
%%pagescale 1.0 % Scales the page
%%stretchlast 0.25 % Is the last staff a full or partial line
%%timewarn 0 % Omit time signature change at end of line
% Now we define which fonts are used for title, composer, chords, etc.
%%titleleft 0
%%pango 0 % Disables Pango (font utility); incompatibilities
%%titlefont Palatino-Bold 20 % Font of title
%%subtitlefont Palatino-Italic 16 % Font of second title
%%composerfont Palatino-Italic 14 % As it says
%%tempofont Palatino-Roman 14 % As it says
%%gchordfont Palatino-Bold 14 % Chord font
%%historyfont Palatino-Roman 16 % History (H:); also S:, N: & Z:
%%partsfont Palatino-Bold 14 % Parts font (e.g. to label
%%partsbox 1 % A, B & C parts of a tune)
%%annotationfont Palatino-Roman 14 % For annotations within the staff
%%textfont Palatino-Roman 16 % For lines of text
%%infofont Palatino-Bold 16 % For info fields (e.g. T:, C:, I:)
% See abc standard 2.2, sec. 11.4.6
%%setfont-1 Palatino-Bold 16 % Allows changing font within a
%%setfont-2 Palatino-Italic 16 % string. $1, $2 to change, $0 to
%%setfont-3 Palatino-Italic 20 % change back to the default
% Adds page numbers, defines labels to be used and which fields will print
%%footer "$P" % Page number
% %%oneperpage true % One tune per page; false = more than one
%%infoname Z "Transcription: " % Defines what label is
%%infoname S "Source: " % used for each field
%%infoname D "Discography: "
%%infoname N % Puts Notes at the end
%%infoname N "Notes: " % Restores Label to Notes
% %%writefields P false % (Causes parts information not to print)
%%writefields NQSDZ % Which fields to print
%%pdfmark 1 % Adds marker for each tune to create tune list
%%setdefl % Postscript code to allow for small noteheads
%%beginps % from Hudson Lacerda, post on abcusers, 5/5/2014
/head-small'{gsave T .6 dup scale 1 0 hd grestore}!
/head-small,{gsave T .6 dup scale -1 0 hd grestore}!
/head-small {defl 4 and 0 eq {head-small,}{head-small'}ifelse} !
%%endps
%%deco head-small 0 head-small 0 0 0
% Defines shortcuts for slides, trills & small noteheads
U: s = !slide!
U: t = !trill!
U: h = !head-small!
% Copy the following if you want a heading at the beginning of your document indicating tune type.
% This section of the File Header puts a centered heading at the top
% of the page naming the tune type (e.g. "Waltzes").
% If you're only copying a few tunes this could be omitted.
%%textfont Palatino-BoldItalic 30
%%text
%%center Marches, Polkas & Two-Steps % Use the category name from the G: field
%%textfont Palatino-Roman 14
% If you want to be able to present tunes alphabetically, one per page, do the following.
% In the section above that starts "% Adds page numbers, defines labels …":
% To eliminate page numbers, change <%%footer "$P"> to read <%%footer ""> (without the brackets),
% or delete the line entirely
% In the line that starts <% %%oneperpage …>, delete the "%" so it reads <%%oneperpage …>
% In EasyABC, go to the Tools menu and choose Sort Tunes…. Then:
% To alphabetize without regard to tune type, make sure the box says "T", and click on OK.
% To sort by tune type and alphabetize within each tune type, type "R,X" in the box and click on OK.
% If you type "G,X" it sorts by groupings and gives fewer categories.
% If you use other abc software, there should be a similar mechanism for sorting the tunes.
The NH Old-Time Fiddle Website covers a variety of topics related to traditional music and dance of New Hampshire and surrounding areas.
Designed & Edited by Peter Yarensky
Contact & About Page + Site News
Use the Menu (upper left) to navigate. Here are the main topics covered on this web site.
Menu