lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: voice solfege sequence


From: Thomas Morley
Subject: Re: voice solfege sequence
Date: Sun, 20 Apr 2014 14:30:57 +0200

2014-04-20 3:23 GMT+02:00 Thomas Morley <address@hidden>:
> 2014-04-19 23:25 GMT+02:00 MING TSANG <address@hidden>:
>> The color solfege will be showing on the lower
>> stack in both case.

> I found no convincing method to set the color for the TextScript, though.
> I used a workaround, hoping someone else comes up with a better solution.

Hi again,

I found a way to clear the 'tweaks for newgrob:

#(define (solfege-engraver lst dir)
   (make-engraver
     (acknowledgers
      ((note-head-interface engraver grob source)
       (let* (
              (context (ly:translator-context engraver))
              (tonic-pitch (ly:context-property context 'tonic))
              (tonic-index (ly:pitch-notename tonic-pitch))
              (event (ly:grob-property grob 'cause))
              (event-copy (ly:event-deep-copy event))
              (grob-pitch (ly:event-property event 'pitch))
              (grob-index (ly:pitch-notename grob-pitch))
              (delta (modulo (- grob-index tonic-index) 7))
              (name (list-ref lst delta))
              (newgrob (ly:engraver-make-grob engraver 'TextScript event-copy))
              (newgrob-cause (ly:grob-property newgrob 'cause))
              (newgrob-tweaks (ly:event-property newgrob-cause 'tweaks)))

         ;; clear 'tweaks for newgrob
         (ly:event-set-property! event-copy 'tweaks '())
         (if (string= name "Hb")  (set! name "B"))
         ;; Give newgrob 'outside-staff-priority depending on
         ;; grob 'staff-position
         (set! (ly:grob-property newgrob 'outside-staff-priority)
               (+ (ly:grob-property newgrob 'outside-staff-priority)
                  (* dir (ly:grob-property grob 'staff-position))))
         (set! (ly:grob-property newgrob 'text) name)
         (set! (ly:grob-property newgrob 'direction) dir) )))))

HTH,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]