lilypond-devel
[Top][All Lists]
Advanced

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

slur information available within callback?


From: Marc Hohl
Subject: slur information available within callback?
Date: Mon, 10 Aug 2009 10:30:54 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

Is there any possibility to retrieve informations about slurs being adjacent from a callback?

For example

\displayMusic { c4 ( c ) ( c ) c }

shows

[...]

(make-music
         'EventChord
         'elements
         (list (make-music
                 'NoteEvent
                 'duration
                 (ly:make-duration 2 0 1 1)
                 'pitch
                 (ly:make-pitch -1 0 0))
               (make-music
                 'SlurEvent
                 'span-direction
                 1)
               (make-music
                 'SlurEvent
                 'span-direction
                 -1)))

[...]

so the two appearances of a 'SlurEvent with opposite sign shows that a slur end and starts on the same note.

Can I retrieve this kind of information from within a callback?

#(define-public (slur::test grob)
 (let* ((left-bound (ly:spanner-bound grob LEFT))
        (right-bound (ly:spanner-bound grob RIGHT))
        (left-note (ly:grob-property left-bound 'cause))
        (right-note (ly:grob-property right-bound 'cause)))

       (display "\nleft note: ")(display (event-cause left-note))(newline)
       (ly:slur::print grob)))

The console output shows only informations about duration, pitch etc., but nothing about the corresponding
slurs. Is this information still accesible at this step, and if yes, how?

Thanks in advance

Marc





reply via email to

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