lilypond-user
[Top][All Lists]
Advanced

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

Confusion about note-column-accidentals


From: Urs Liska
Subject: Confusion about note-column-accidentals
Date: Fri, 31 Mar 2017 10:09:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

Hi,

I'm confused about the handling of accidentals in tied notes/chords.

ly:note-column-accidentals returns either an AccidentalPlacement object or an empty list. I found out that the AccidentalPlacement's X-extent interacts in a somehow strange way with the NoteColumn's X-offset, but that's (probably) not the issue here.

What I'm wondering here is: in a tied note/chord there is an AccidentalPlacement object with an X-extent, even if the accidentals are not displayed:

\version "2.19.57"

{
  \override TieColumn.after-line-breaking = 
  #(lambda (tc)
     (let* ((rb (ly:grob-parent (ly:spanner-bound tc RIGHT) Y))
            (accs (ly:note-column-accidentals rb))
            (accs-extent 
             (if (null? accs)
                 "No AccidentalPlacement object."
                 (ly:grob-property accs 'X-extent))))
       (display accs-extent)))
  
  % No accidentals in chord: No AccidentalPlacement object
  %<c' f' g' b'>1 ~ q
  % Accidentals in chord: AccidentalPlacement object on the right column
  % even if it is not shown.
  <c' fis' gis' bis'>1 ~ q
}

% displays (-4.05 . -0.35)

In order to determine the spacing to the left of a tied note column I thought I could rely on the presence or absence of the AccidentalPlacement, but obviously this isn't the case.

So could someone give an explanation (or at least a suggestion) why this AccidentalPlacement is there and - more importantly - how I can reliably determine the presence or absence of the visual accidentals (at the time of stencil override)?

TIA
Urs
-- 
address@hidden
https://openlilylib.org
http://lilypondblog.org

Attachment: document.png
Description: PNG image


reply via email to

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