[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Complex chords with splayed stems - Script-positioning
From: |
David Nalesnik |
Subject: |
Re: Complex chords with splayed stems - Script-positioning |
Date: |
Sat, 28 Jul 2012 17:12:11 -0500 |
Hi Harm,
This is cool!
The problem is in the definition of splayedStemChord: NoteHead is the
X-parent of Script, so you're missing a step en route to NoteColumn.
Also, it turns out you need to override 'after-line-breaking rather
than 'before-line-breaking.
> splayedStemChord =
> #(define-music-function (parser location l1 l2 mus)
> (list? list? ly:music?)
> #{
> \once \override Flag #'stencil = #new-flag-stencil
> \once \override Score.NoteColumn #'before-line-breaking =
> #new-X-extent
> \once \override Stem #'positioning-done = #(positioning-done l1 l2)
> \once \override Stem #'stencil = #splayed-stem-stencil
>
>
> \once \override Score.Script #'before-line-breaking =
> #(lambda (grob)
> (let* ((nc (ly:grob-parent grob X))
> (nh (ly:grob-array->list (ly:grob-object nc
> 'note-heads))))
> (set! (ly:grob-parent grob X)
> (car nh))))
>
> $mus
> #})
Try this:
splayedStemChord =
#(define-music-function (parser location l1 l2 mus)
(list? list? ly:music?)
#{
\once \override Flag #'stencil = #new-flag-stencil
\once \override Score.NoteColumn #'before-line-breaking = #new-X-extent
\once \override Stem #'positioning-done = #(positioning-done l1 l2)
\once \override Stem #'stencil = #splayed-stem-stencil
\once \override Score.Script #'after-line-breaking =
#(lambda (grob)
(let* ((note-head (ly:grob-parent grob X))
(nc (ly:grob-parent note-head X))
(nh (ly:grob-array->list (ly:grob-object nc 'note-heads))))
(set! (ly:grob-parent grob X)
(car nh))))
$mus
#})
HTH,
David