Li Jie Wong <lijie.w...@gmail.com> writes: > Is it possible to make a function that will do the equivalent of... > > \break > > when at a bar boundary, and > > \bar "" \break > > otherwise? > > Basically, I just want a line break at a point, without lilypond fussing > about whether the break is at a valid position or not, but I also don't > want to erase any bar lines (which happens if I just indiscriminately use > \bar "" \break).
Not sure this is the best way: it seems sort of hackish.
maybeBreak = \context Score \applyContext #(lambda (c) (if (not (string? (ly:context-property c 'whichBar))) (set! (ly:context-property c 'whichBar) ""))) { r8 \repeat unfold 40 { r4 \bar "|" \maybeBreak r2 \maybeBreak r4 } r2.. | \bar "|." }
-- David Kastrup
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user