Le jeudi 11 septembre 2025 à 14:35 +0200, Volodymyr Prokopyuk a écrit :
Hi,
How to correctly place bar lines when using a compound meter?
I want
image.png
The code
\version "2.25.28"
\new PianoStaff = bayan <<
\new Staff = rightHand {
\relative {
\tempo Adagio
\clef treble
\key e \minor
\compoundMeter #'((4 4) (2 4))
b=4(\p g' fis8 a g fis | e2) | b4( g' a8 g fis d | g2) |
}
}
\new Staff = leftHand {
\relative {
\clef bass
\key e \minor
}
}
The command | is not for printing a bar line. It is an assertion that
measure should finish at this point, which in your case is every 6
beats. The | command has no effect on the output but is useful to locate
typing errors.
Bar lines are drawn with the \bar command. So you could write
b=4(\p g' fis8 a g fis \bar ";" e2) \bar "|"
The \bar "|" is redundant since a normal bar line is printed
automatically. If you have many measures in compound time, you could add
in parallel to your piano staff something like
\repeat unfold 50 { s1 \bar ";" s2 \bar "|" }
Jean's solution redefines the | command to be \bar "|"
--
Timothy Lanfear, Bristol, UK.