lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: accidentals and broken bars


From: Kevin Barry
Subject: Re: accidentals and broken bars
Date: Sun, 09 Aug 2020 11:44:34 +0100
User-agent: Evolution 3.36.4 (3.36.4-1.fc32)

On Sun, 2020-08-09 at 06:48 +0200, Werner LEMBERG wrote:
> Thanks for the explanation.  What about the other way round, this is,
> adding some information to the invisible bar line that defines a
> broken bar, and which accidentals could use to print themselves in
> such cases?

You could try something like
maybeBreak =
#(define-music-function (music) (ly:music?)
   #{
     \bar ""
     \accidentalStyle forget
     #music
     \accidentalStyle modern
   #})
but that would force accidentals to be reprinted even if the line does
not get broken.

To get around that you could write some kind of callback for accidentals
that would remove them when not at the beginning of a line as long as
they are not new. I tried to do this but got stuck trying to detect if
an accidental was new at that point in the bar or not. I was trying to
use the localAlterations property but I was only ever able to see the
last value of it. If there's a way a grob callback can check a context
property at the moment of the event that caused the grob I don't know
it. (I say this just in case anyone else does know how.)

Kevin 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]