|
From: | tisimst |
Subject: | Re: Directional NoteHead Stencil Support |
Date: | Sat, 21 Mar 2015 19:13:17 -0700 (MST) |
#(define (flipnotes grob)(let ((notes (ly:grob-array->list (ly:grob-object grob 'note-heads))))(for-each(lambda (note)(let* ((pitch (ly:event-property (event-cause note) 'pitch))(stem (ly:grob-object note 'stem))(dir (ly:grob-property stem 'direction))(offset (ly:grob-relative-coordinate note grob X)))(if (eq? dir DOWN)(if (and (< offset 0.1) (> offset -0.1))(ly:grob-set-property! note 'rotation '(180 0 0))(ly:grob-set-property! note 'rotation '(0 0 0)))(if (and (< offset 0.1) (> offset -0.1))(ly:grob-set-property! note 'rotation '(0 0 0))(ly:grob-set-property! note 'rotation '(180 0 0))))))notes)))
In procedure ly:grob-array->list in _expression_ (ly:grob-array->list (ly:grob-object grob #)): Wrong type argument in position 1 (expecting Grob_array): ()
Hi,On Sat, Mar 21, 2015 at 4:32 PM, tisimst <[hidden email]> wrote:You and me both, Pierre. I've tried for hours to find something that works automatically. I've managed to use a single notehead for both up- and down-stem notes, thanks to everyone's help here, but I still have one problem relating to chords.If a notehead, in a chord stack, is forced out of the main column (to the right for up-stem chords, to the left for down-stem chords) what property (or relationship between grobs) puts them there? I can't seem to figure it out.- AbrahamIf there's a property which indicates on which side of a stem the note falls, I don't find it. Seems like there definitely should be one!Anyway, here's a snippet which suggests a possible way to go. It prints out the X-coordinate of the note heads in a chord, relative to the organizing NoteColumn.\version "2.19.17"{\override NoteColumn.before-line-breaking =#(lambda (grob)(let ((notes (ly:grob-array->list (ly:grob-object grob 'note-heads))))(for-each(lambda (note)(format #t "~a at coordinate: ~a~%"(ly:event-property (event-cause note) 'pitch)(ly:grob-relative-coordinate note grob X)))notes)(newline)))<c' d' e' g' c'' d''><cis'' fis'' gis''>}%%%%And the output:#<Pitch c' > at coordinate: 0.0
#<Pitch d' > at coordinate: 1.251178
#<Pitch e' > at coordinate: 0.0
#<Pitch g' > at coordinate: 0.0
#<Pitch c'' > at coordinate: 0.0
#<Pitch d'' > at coordinate: 1.251178
#<Pitch cis'' > at coordinate: 0.0
#<Pitch fis'' > at coordinate: -1.251178
#<Pitch gis'' > at coordinate: 0.0
Hope this helps!!
-David
_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
If you reply to this email, your message will be added to the discussion below:http://lilypond.1069038.n5.nabble.com/Directional-NoteHead-Stencil-Support-tp173361p173452.htmlTo start a new topic under User, email [hidden email]
To unsubscribe from Lilypond, click here.
NAML
[Prev in Thread] | Current Thread | [Next in Thread] |