[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Forcing line breaks without changing bar lines
From: |
David Kastrup |
Subject: |
Re: Forcing line breaks without changing bar lines |
Date: |
Mon, 05 Jun 2017 17:57:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Li Jie Wong <address@hidden> 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