2012/12/10 Paul Morris <[email protected]>:
>> I'm not top posting.
>
> % All the notes should be moved to the right-hand
> % side of the stem by overriding their X-offset
> % property, but something about the "rel-coord"
> % variable that is set by "ly:grob-relative-coordinate"
> % prevents this from working as it should. After
> % removing that variable it works fine. Setting
> % X-extent also does not work (this is commented
> % out below).
>
> \version "2.16.1"
>
> CustomNoteHeads =
> #(lambda (grob)
> (let* (
> (notecol (ly:grob-parent grob 0))
> (rel-coord (ly:grob-relative-coordinate grob notecol 0)))
> (set! (ly:grob-property grob 'X-offset) 1.251178 )
>
> ;; (set! (ly:grob-property grob 'X-extent) '(0 . 4) ))
> )
>
> \score {
> \new Staff
> \with {
> \override NoteHead #'before-line-breaking = \CustomNoteHeads
> }
> { c' d' e' f' }
> \layout { }
> }
Hi Paul,
please be very careful with the code you post.
You commented a _needed_ closing bracket.
Nevertheless, I can't explain why your code doesn't work.
Speculating, I'd say 'X-offset and 'X-extent are the wrong properties
with 'before-line-breaking.
Using 'extra-spacing-width and ly:grob-translate-axis! for offset in
X-axis seems to work:
\version "2.16.1"
CustomNoteHeads =
#(lambda (grob)
(let* (
(notecol (ly:grob-parent grob X))
(rel-coord (ly:grob-relative-coordinate grob notecol 0)))
(ly:grob-set-property! grob 'extra-spacing-width '(-1 . 1))
(ly:grob-translate-axis! grob 1.251178 X)))
\score {
\new Staff
\with {
\override NoteHead #'before-line-breaking = \CustomNoteHeads
}
{ c' d' e' f' }
\layout { }
}
But there _is_ something strange with 'X-offset in chords.
In the examples below _none_ of the tweaks work. But if you uncomment
the tweak for the _first_ written note of the chord they work _all_.
\version "2.16.1"
\relative c' {
<
%\tweak #'X-offset #1
f
\tweak #'X-offset #2
a
\tweak #'X-offset #3
c
>
<
%\tweak #'X-offset #2
a
\tweak #'X-offset #1
f
\tweak #'X-offset #3
c'
>
}
No idea why.
Cheers,
Harm
_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond