Bars and mesures


1 voice + simple bars

Q:1/1=40
L:1/4
C D E F | G A B c |]
Q:1/1=40 L:1/4 C D E F | G A B c |]

1 voice + repeat bar with only end

Q:1/1=40
L:1/4
C D E F :| G A B c |]
Q:1/1=40 L:1/4 C D E F :| G A B c |]

1 voice + anacrouse + repeat bar with begin and end

Q:1/1=80
L:1/2
C/ |: D E :| F G |]
Q:1/1=80 L:1/2 C/ |: D E :| F G |]

1 voice + anacrouse + repeat bar with begin and end with 1 2

Q:1/1=80
C/ |: D |1 E :|2 F | G |]
Q:1/1=80 C/ |: D |1 E :|2 F | G |]
1 2

1 voice + anacrouse + repeat bar with begin and end with 1 2

Q:1/1=80
C/ |: D |1 E :|2 F | G |: A | B :| c/ |]
Q:1/1=80 C/ |: D |1 E :|2 F | G |: A | B :| c/ |]
1 2

1 voice + multiple repeat

Q:1/1=80
L:1/4
|: C D E F | G F E D |[1 C2 G2 :|2 C2 C2 || c3 z ||
|: C D E F |1-3 c d e f :|4,5 C2 G2 :|["last time" C G C z |]
Q:1/1=80 L:1/4 |: C D E F | G F E D |[1 C2 G2 :|2 C2 C2 || c3 z || |: C D E F |1-3 c d e f :|4,5 C2 G2 :|["last time" C G C z |]
1 2 1-3 4,5 last time

1 voice + triple repeat

Q:1/1=80
L:1/4
CDEF | GFED [| CDEF |: GFED :|CDEF :: GFED || CDEF [|] GFED
CDEF |[| GFED :::|] CDEF : GFED |]
Q:1/1=80 L:1/4 CDEF | GFED [| CDEF |: GFED :|CDEF :: GFED || CDEF [|] GFED CDEF |[| GFED :::|] CDEF : GFED |]

%%equalbars boolean

This command changes the rendering so that, in a music line, the measures have a width proportional to their duration.
It may be used as a replacement for the (ugly) %%alignbars of abcm2ps.
If you also want the beats to be aligned, %%notespacingfactor 2 might help.
Align the bars of the next int music lines.

L:1/4
c4 | cccc | cccc | cccc |
c4 | c3c | cc3 | c2c2 |
c4 | cccc | cccc | c/c/c/c/c2 |
L:1/4 c4 | cccc | cccc | cccc | c4 | c3c | cc3 | c2c2 | c4 | cccc | cccc | c/c/c/c/c2 |

L:1/4
%%equalbars 1
c4 | cccc | cccc | cccc |
c4 | c3c | cc3 | c2c2 |
c4 | cccc | cccc | c/c/c/c/c2 |
L:1/4 %%equalbars 1 c4 | cccc | cccc | cccc | c4 | c3c | cc3 | c2c2 | c4 | cccc | cccc | c/c/c/c/c2 |

%%barsperstaff int

Try to typeset with int bars on each line when int is not null.

L:1/4
cccc | cccc | cccc |
cccc | cccc | cccc |
cccc | cccc |
L:1/4 cccc | cccc | cccc | cccc | cccc | cccc | cccc | cccc |

%%barsperstaff 4
L:1/4
cccc | cccc | cccc |
cccc | cccc | cccc |
cccc | cccc |
%%barsperstaff 4 L:1/4 cccc | cccc | cccc | cccc | cccc | cccc | cccc | cccc |

%%break

L:1/4
cccc | cccc | cccc | cccc |
cccc | cccc | cccc | cccc |
L:1/4 cccc | cccc | cccc | cccc | cccc | cccc | cccc | cccc |

T:force a line break before measure #7
L:1/4
%%measurenb 1
%%break 7
cccc | cccc | cccc | cccc |
cccc | cccc | cccc | cccc |
T:force a line break before measure #7 L:1/4 %%measurenb 1 %%break 7 cccc | cccc | cccc | cccc | cccc | cccc | cccc | cccc |
force a line break before measure #7 2 3 4 5 6 7 8

%%stretchlast float

Stretch the last music line of a tune when it lacks less than the float fraction of the page width.
float range is 0.0 to 1.0.

L:1/4
cccc | cccc | cccc |
cccc | c4 |]
L:1/4 cccc | cccc | cccc | cccc | c4 |]

%%stretchlast 0.5
L:1/4
cccc | cccc | cccc |
cccc | c4 |]
%%stretchlast 0.5 L:1/4 cccc | cccc | cccc | cccc | c4 |]

%%stretchstaff bool

Stretch the last music line of a tune when it lacks less than the float fraction of the page width.
float range is 0.0 to 1.0.

L:1/4
cccc |
cccc | cccc | cccc |cccc |
cccc | cccc |
L:1/4 cccc | cccc | cccc | cccc |cccc | cccc | cccc |

L:1/4
%%stretchstaff 0
cccc |
cccc | cccc | cccc |cccc |
cccc | cccc |
L:1/4 %%stretchstaff 0 cccc | cccc | cccc | cccc |cccc | cccc | cccc |

%%measurenb int

If positive, draw the measure number every int bars.
If int = 0, the measure number appears only on the left of the staff systems.
On the command line only, if a trailing 'b' is present, a box is also drawn around the measure numbers.

%%measurenb 2
M:2/4
L:1/4
cc | cc | cc | cc |
cc | cc | cc | cc
%%measurenb 2 M:2/4 L:1/4 cc | cc | cc | cc | cc | cc | cc | cc
2 4 6 8

%%measurenb 0
M:2/4
L:1/4
cc | cc | cc | cc |
cc | cc | cc | cc
%%measurenb 0 M:2/4 L:1/4 cc | cc | cc | cc | cc | cc | cc | cc
5

%%measurebox bool

Draw a box around the measure numbers.
This value may be set to 'true' by the option box in %%measurefont.

%%measurenb 1
%%measurebox 1
L:1/4
cccc | cccc | cccc | cccc |
%%measurenb 1 %%measurebox 1 L:1/4 cccc | cccc | cccc | cccc |
2 3 4

%%setbarnb int

Set the number of the next measure.
When this command appears at the beginning of the tune (after K:), only the 2nd measure will have the new number. It must appear in the tune header to set the first measure.

%%setbarnb 10
%%measurenb 1
L:1/4
cccc | cccc | cccc |
%%setbarnb 10 %%measurenb 1 L:1/4 cccc | cccc | cccc |
10 11 12

%%contbarnb bool

If not set, the bar number of the second repeat(s) is reset to the number of the first repeat.
If set, the bars are sequentially numbered.

%%measurenb 1
L:1/4
cccc |1 cccc :|2 cccc !rbstop!|
cccc | c4 ||
%%measurenb 1 L:1/4 cccc |1 cccc :|2 cccc !rbstop!| cccc | c4 ||
1 2 2 2 3 4

%%measurenb 1
%%contbarnb 1
L:1/4
cccc |1 cccc :|2 cccc !rbstop!|
cccc | c4 ||
%%measurenb 1 %%contbarnb 1 L:1/4 cccc |1 cccc :|2 cccc !rbstop!| cccc | c4 ||
1 2 2 3 4 5

%%dblrepbar bar

Define how the double repeat bars (::, :|: :||:) are drawn.

L:1/4
cccc :: cccc |
L:1/4 cccc :: cccc |

%%dblrepbar ::
L:1/4
cccc :: cccc |
%%dblrepbar :: L:1/4 cccc :: cccc |

%%dblrepbar :|:
L:1/4
cccc :: cccc |
%%dblrepbar :|: L:1/4 cccc :: cccc |

%%dblrepbar :||:
L:1/4
cccc :: cccc |
%%dblrepbar :||: L:1/4 cccc :: cccc |

%%rbmax int, %%rbmin int, %%rbdbstop bool

These parameters define how the repeat brackets are drawn.
When rbdbstop is set (true default), the repeat brackets stop on a double bar ("||").
The rbmax value (4 by default) is the maximum number of mesure bars which are searched for stopping a repeat bracket.
If no stopping bar is found, the repeat bracket is stopped at the rbminth bar.
The rbmin defaut value is 2.

T:default values
L:1/4
c4|1c4|c4|c4|c4:|2\
c4|c4|c4|c4|c4||
c4|1c4|c4|c4|c4|c4:|2\
c4|c4|c4|c4|c4||
T:default values L:1/4 c4|1c4|c4|c4|c4:|2\ c4|c4|c4|c4|c4|| c4|1c4|c4|c4|c4|c4:|2\ c4|c4|c4|c4|c4||
default values 1 2 1 2

T:max=3 min=1
L:1/4
%%rbmax 3
%%rbmin 1
c4|1c4|c4|c4|c4:|2\
c4|c4|c4|c4|c4||
c4|1c4|c4|c4|c4|c4:|2\
c4|c4|c4|c4|c4||
T:max=3 min=1 L:1/4 %%rbmax 3 %%rbmin 1 c4|1c4|c4|c4|c4:|2\ c4|c4|c4|c4|c4|| c4|1c4|c4|c4|c4|c4:|2\ c4|c4|c4|c4|c4||
max=3 min=1 1 2 1 2