lilypond-user
[Top][All Lists]
Advanced

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

Edition Engraver, TieColums and line breaks


From: Stefano Troncaro
Subject: Edition Engraver, TieColums and line breaks
Date: Sun, 1 Apr 2018 16:32:35 -0300

Hi all!

I currently have a function that accesses some grobs through their "containers"(NoteHeads/Accidentals in NoteColumns, Ties in TieColumns) and lets me tweak properties (individually if needed) of each. This is done in a single override so it works with the Edition Engraver. But I've come up with a situation which I don't know how to handle.

I just noticed that when a Tie (or Ties) crosses a line break, two TieColumns are generated, one containing each "half". See:
\version "2.19.80"

inspectTies =
#(define-music-function (example-name) (string?)
   #{ \override TieColumn.before-line-breaking =
      #(lambda (tc)
         (let ((ties (ly:grob-object tc 'ties)))
           (pretty-print (format "~a, before line breaking: ~a" example-name ties))))
      \override TieColumn.after-line-breaking =
      #(lambda (tc)
         (let ((ties (ly:grob-object tc 'ties)))
           (pretty-print (format "~a, after line breaking: ~a" example-name ties)))) #} )

\score {
  \relative c'' {
    <c g e>1~ \break |
    \inspectTies "With a chord" q
  }
}

\score {
  \relative c'' {
    c1~ \break |
    \inspectTies "With a note" c
  }
}

\score {
  \relative c'' {
    c1~ |
    \inspectTies "With a note and no line breaking" c
  }
}


Gives the following output in the Lilypond Log:

"With a chord, before line breaking: #<Grob_array#<Grob Tie > #<Grob Tie > #<Grob Tie > >"

"With a note, before line breaking: #<Grob_array#<Grob Tie > >"

"With a note and no line breaking, before line breaking: #<Grob_array#<Grob Tie > >"

"With a chord, after line breaking: #<Grob_array#<Grob Tie > #<Grob Tie > #<Grob Tie > >"

"With a chord, after line breaking: #<Grob_array#<Grob Tie > #<Grob Tie > #<Grob Tie > >"

"With a note, after line breaking: #<Grob_array#<Grob Tie > >"

"With a note, after line breaking: #<Grob_array#<Grob Tie > >"

"With a note and no line breaking, after line breaking: #<Grob_array#<Grob Tie > >"


Since both TieColumns seem to exist in the same moment, how can I differentiate between the two? More specifically, how can I make sure that I'm in the TieColumn that is on the second system?

Say, for instance, that I want to get to the ties contained in a TieColumn and modify some properties. Getting to the Ties that are on the end of the first system is easy because I can do that through TieColumn.before-line-breaking, which takes effect before the Ties are "split". But how can I make sure I'm in the second one? I don't know what property I could check.

Any help would be greatly appreciated!
Stéfano

reply via email to

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