Bar lines

Each measure must be ended with a "bar" of some kind. There are several kinds:

Keyword               Meaning

bar           ordinary bar line
dblbar        double bar
repeatstart   beginning of repeated section
repeatboth    end of one repeated section and beginning of another
repeatend     end of repeated section
endbar        heavy double bar line used at end of song
invisbar      no bar line printed
restart       end staffs and begin anew

In addition, the bar and dblbar types can be preceeded by the word "dashed" or "dotted" to produce dashed or dotted bar lines.


1: mr;
bar
1: mr;
dblbar
1: mr;
dashed bar
1: mr;
dotted dblbar
1: mr;
repeatstart
1: mr;
repeatboth
1: mr;
repeatend
1: mr;
endbar

Picture of Mup output

Sometimes music is printed without bar lines. The "invisbar" can be used in this case, to fulfill Mup's requirement to specify some sort of bar after every measure without actually printing bar lines.

The restart is a special kind of bar. It follows immediately after another bar line without any intervening music data. (That is, you can't have any notes. You can use score or staff context things, like changing time or key signature.) It would be most commonly used for something like a short coda.

score
	staffs=2
	brace=1-2
staff 2
	clef=bass
music

1-2: c;d;e;f;
rom above 1: 3 "D.C. al Coda";
dblbar

// The restart follows a bar
// without any music data in between.
restart

rom above 1: 1 "Coda";
1-2: f;e;d;c;
endbar

Picture of Mup output

There are several optional directives that can follow the bar line keyword. They can be specified in any order and are described below.

Bar line padding

One optional directive is padding. It can be used to force Mup to place extra white space to the left of the bar line. It is specified by the keyword "pad" followed by a number of stepsizes of padding to add. For example:

dblbar pad 3

would add 3 stepsizes of padding.

Bar line location tag

It is also possible to associate a location tag with a bar line. For example:

// Associate tag "_bar6" with bar line
bar =_bar6

// Do double bar with an extra stepsize of
// padding, and associate tag "q"
// with the bar line
dblbar pad 1 =q

The y coordinate of a bar line is not very useful. Special rules apply if a bar line happens to be placed at the end of a score. Any locations taken relative to the bar that would be to the right of the bar are treated as if the bar line were at the beginning of the following score, just beyond the clef and time and key signatures, if any.

Endings

First and second endings, etc. can be designated at bar lines. This is done with the keyword "ending," followed by a quoted string to use as the label for the ending that should begin at the bar line. An ending will span bars until either another ending is specified, the piece ends, or the special keyword "endending" is used. Examples:

bar ending "1."
repeatend ending "2-3"
endbar endending

The ending label will always be forced into 12 point times roman font. If you change font or size or include special characters in the ending label, the output is not likely to be aligned properly.

The "endingstyle" parameter controls where endings are placed. Endings cannot start at or cross over a restart bar.

Rehearsal marks

Rehearsal letters or numbers can be specified on any bar line. There are four formats:
rehearsal let
rehearsal num
rehearsal mnum
rehearsal "label"

In the first example, a rehearsal letter will be placed on the bar. The first occurrence of this will become rehearsal "A", the next "B", and so forth. The second format works in a similar fashion except that numbers are used rather than letters. With the third format, the current measure number is used. With the last format, any arbitrary string within the quotes will be used. The keyword "rehearsal" can be abbreviated to "reh" if you wish. Only one rehearsal mark is allowed on any one bar, but the types can be mixed throughout the composition. (Note that mixing "num" with "mnum" is likely to be very confusing, however.) The rehearsal marks can be intermixed with other bar options:

1: 1c;
dblbar reh num ending "1"
1: 1e;
repeatend pad 1 =_xyz reh let ending "2."
1: 1g;
bar rehearsal "Duet"
1: 1ce;
endbar endending

Picture of Mup output

The rehearsal marks are normally put directly above the bar line. However, if the bar line falls at the end of a score, the rehearsal mark will be placed at the beginning of the following score, after the clef, key signature, and time signature. The "endingstyle" parameter is used to determine which staffs get rehearsal marks. The "rehstyle" parameter specifies whether to put rehearsal marks inside a box or a circle or leave them plain.

The rehearsal keyword may be followed by a specification for fontfamily, font, and/or (size). Once specified, these remain in effect for any future rehearsal marks, until explictly changed. Some examples:

bar rehearsal helvetica bold (14) let
repeatend reh newcentury num
invisbar reh rom (10) mnum

After all the options listed above, you may specify "dist N" where N is some number of stepsizes. This will override the dist parameter for determining how close to the staff to place the rehearsal mark. If the number is followed by a "!" Mup will place the mark exactly that far from the top of the staff, even if it overwrites other things; otherwise the value specifies a minimum distance.

rehearsal num dist 5     // at least 5 stepsizes away
reh bold "A1" dist 2 !   // exactly 2 stepsizes away

Setting the measure number

Mup keeps track of measure numbers automatically, but sometimes you may want to override this to set the current measure number to some specific value. This is done by adding "mnum=number on a bar line, which will set the current measure number to the given number.

// Set the current measure number to 50
dblbar mnum=50

Hiding time/key signature and clef changes

Generally in printed music, when a time signature or key signature change occurs at the beginning of a score, these changes are also printed at the very end of the previous score, to make it clear there is a change coming up. Mup normally does this, but occasionally you may not want that behavior. Sometimes you may want to make a new score appear like the beginning of a new piece. If you wish to suppress the printing of time signature, key signature, and clef changes at the end of the preceding score, you can use the "hidechanges" keyword on the bar line at which the changes occur. Hidechanges cannot be used on a restart bar.

1: c;d;e;f;
bar
// change time/key with normal treatment

newscore
score time=5/4 ; key = 1&
music
1: d;e;f;2g;
// don't show changes at end of previous score
bar hidechanges	

newscore

score time=6/4 ; key = 2#
music
1: d;e;f;2.g;
bar

Picture of Mup output

Mup User's Guide Table of Contents