On Dec 12, 2012, at 7:24 PM, Thomas Morley <thomasmorle...@googlemail.com> wrote:
> Hi Paul, > > I had a look at the LSR-snippet > http://lsr.dsi.unimi.it/LSR/Item?id=861 > > It's no problem to make it work with 2.14.2 just adding a $-sign > before offsets in the music-function. > > But you will have noticed that after applying the function an > additional override for 'stem-attachment is necessary in many cases. > You should show how to do this. At least for some examples. > > In general I'd prefer to have a more automated way for offsetting the > NoteHeads. > The hardcoded value of 1.251178 will change for different NoteHeads and > styles. > > I'll continue to think about it. ;) > > > Regards, > Harm Hi Harm, Thanks for taking a look at it and for the tip on using a $-sign for 2.14.2. I was also thinking about the best way to correct the 'stem-attachment values. It would be nice if that could be automatic. I had emailed David Nalesnik to ask about posting his code to the LSR, and he also had the concern about the hard-coded 1.251178. He sent me the following which automatically calculates the offset amount based on the width of the NoteHead, so I will update the snippet with this revision. #(define ((shift offsets) grob) (let* ((note-heads (ly:grob-array->list (ly:grob-object grob 'note-heads))) (stem (ly:grob-object grob 'stem)) (stem-ext (ly:grob-property stem 'X-extent))) (for-each (lambda (p q) (let ((head-ext (interval-length (ly:grob-property p 'X-extent)))) (ly:grob-translate-axis! p (* q (- head-ext (cdr stem-ext))) X))) note-heads offsets))) displaceHeads = #(define-music-function (parser location offsets) (list?) #{ \once \override NoteColumn #'before-line-breaking = #(shift offsets) #} ) Regards, -Paul _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user