3

\omit Staff.Barline works a treat for getting rid of bar lines, but when I get to the end of the score I do want a barline — just one — the usual final double bar line.

There must be a \once \include directive or something, but I can't find it.

3 Answers 3

4

Another way to get rid of barlines is by setting them to be "empty", i.e. with \set Score.measureBarType = "" (or \set Staff.measureBarType = "").

Now when you want a barline (of any type), it's as simple as placing them in manually, e.g. with: \bar "|", \bar "||", \bar "|.", etc.

4

This is possibly an XY question. If you are writing unmetered music, then you should not "remove bar lines", as this will leave traces in the spacing, bar numbers, etc. Instead, you should use the dedicated \cadenzaOn command.

3

\omit Staff.BarLine is in fact equivalent to \override Staff.BarLine.stencil = ##f, so you can revert it by doing \revert Staff.BarLine.stencil.

But as Elements already said, the probably more reasonable solution is to tell Lilypond to use bar type "" as default bar.

1
  • 1
    \undo \omit Foo is equivalent to \revert Foo.stencil (ref). For readability it's probably best to pair \omit and \undo \omit.
    – benrg
    Nov 29, 2023 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.