Header3
PageHeader
Body
Body Large (20/130%/14)
Body Large (20/130%/14) #2

New England Fiddling: About the Music

The Headers Page

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.

 

Links to Related Pages

 

Structure of an abc Document: Quick Review

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.

  • The Document File Header comes at the beginning of an abc document, and controls formatting for all abc tunes in the document. The Tune File Header comes right before a tune, and contains formatting instructions for that tune only.

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).

  • For this reason I include any Tune File Headers inside the tune even though that’s not normal practice. But Document File Headers still get left out. Therefore I include the Document File Header below, along with instructions on how to use it; and I include a link to this page inside every tune.

How to Copy a Tune and Preserve Formatting

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.

  • Copy the tune(s) you are interested in using (select the text, then Edit  ➛ Copy).
  • In EasyABC, create a new blank document (File  ➛ New).
  • Click in the ABC Code section of the document, and hit the Return key a couple times to create blank lines.
  • Now paste the tune you copied before (Edit  ➛ Paste).
  • The File Header is reproduced immediately below. Copy it, starting with the first percentage sign, and then paste it into one of the blank lines at the top of your abc file.
    • There are two optional sections at the bottom: one for putting a header for tune type at the beginning of the document, and one for alphabetizing and presenting tunes one per page. Only copy those if you need those features.
  • EasyABC for the Mac doesn't assign the file extension, so when you save a tune be sure to add ".abc" at the end of your file name.

That's it — you're done!

 

The Document File Header for All Tunes on This Website

 

 

%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

 

% 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.

Header2TopLine
abc Codexx
Tune Links (16, indented)