There have been a couple bug-reports (3669 3677) coming from users wanting to access LilyPond's layout decisions, in order to adjust those decisions. The surprises come from LilyPond being at an intermediate stage in the decision-making process when the user function is activated.
Issue 3677 is adjusting the position of slurs with a callback function, reduced to a diagnostic print here : #(define (callback-function grob) (let* ((bound (ly:spanner-bound grob LEFT)) (ref (ly:grob-system bound))) ;; print the extent of the left NoteColumn relative to the system: (display (ly:grob-extent bound ref Y)) '(0 . 0))) { \clef alto \override Slur #'positions = #callback-function R1 \break d'1( e') } The reference point 'ref' is the System, with origin usually the uppermost point in the System, so the output would normally be (-2 . -1). If we remove the \break, however, the Staff seems not yet to have been placed in the System when #'positions is evaluated; the Staff reference point (the midline) seems to be at the reference point of the System, as the note-head is reported to span (0 . 1). (Things get more complicated if there is a RehearsalMark, which inserts itself on the first Staff, probably moving that Staff down relative to System, when its property 'after-line-breaking = move-to-extremal-staff is evaluated.) The layout in LilyPond is not driven by a procedure; the functions that make layout decisions call each other as needed (functional, rather than procedural, programming). So callbacks generally should handle being called whenever the decision they support is requested. My only suggestion right now is to try to write callback functions that are robust to being activated at different stages of layout. Can anyone see a way to write the \shapeII function at <http://lists.gnu.org/archive/html/lilypond-user/2013-11/msg00832.html> so that it computes self-consistent positions for a slur using data either before, or after, LilyPond has placed each Staff relative to the System ? _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel