[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate
From: |
Thomas Morley |
Subject: |
Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate |
Date: |
Tue, 11 Dec 2012 00:37:01 +0100 |
2012/12/10 Paul Morris <address@hidden>:
>> 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
- NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/09
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate,
Thomas Morley <=
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Colin Hall, 2012/12/10
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Keith OHara, 2012/12/10
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Colin Hall, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Thomas Morley, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Colin Hall, 2012/12/14
Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/10