lilypond-user
[Top][All Lists]
Advanced

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

Re: [frogs] Re: Numeric note heads for singers


From: address@hidden
Subject: Re: [frogs] Re: Numeric note heads for singers
Date: Sun, 10 Jan 2010 23:57:47 +0100 (GMT+01:00)


>----Original Message----
>From: address@hidden
>Date: 10/01/2010 19:46 
>To: <address@hidden>
>Cc: "Ian Hulin"<address@hidden>, "address@hidden"<lilypond-
address@hidden>, "address@hidden"<address@hidden>, <address@hidden
edu>
>Subj: Re: [frogs] Re: Numeric note heads for singers
>
>
>
>>----Original Message----
>>From: address@hidden
>>Date: 10/01/2010 19:16 
>>To: "address@hidden"<address@hidden>
>>Cc: "Ian Hulin"<address@hidden>, "address@hidden"
<address@hidden
>net>, "address@hidden"<address@hidden>, 
<address@hidden
>edu>
>>Subj: Re: [frogs] Re: Numeric note heads for singers
>>
>>2010/1/10 address@hidden <address@hidden>:
>>
>>> Could you try running the lily source below which I think 
provides 
>a
>>> simple means to the same end and could be turned into a snippet? 
If 
>you
>>> then still think it would be useful to have this automated, I'll
>>> continue where I left off.
>>
>>If you want to automate this, it can now be easily done without
>>touching the C++ code, since Han-Wen's just added basic support for
>>scheme-programmable engravers.  It's a good candidate for a
>>documentation snippet, since it would be a gentle introduction to
>>rolling one's own engravers in scheme.
>>
>>Regards,
>>Neil
>>
>>
>
>I think this makes a lot of sense. Thanks for the feedback.
>
>- David.

Actually, the new scheme engraver functionality is so good that the 
code below seems to do the trick. Unfortunately, it doesn't demonstrate 
very much of what can be done with engravers, but I can turn it into a 
snippet if it would be useful.

- David.

 #(define ez-numbers-engraver (list
  (cons 'acknowledgers
   (list
     (cons 'note-head-interface
       (lambda (engraver grob source-engraver)
         (let* (
           (context (ly:translator-context engraver))
           (tonic (ly:context-property context 'tonic))
           (tonic-index (ly:pitch-notename tonic))
           (grob-pitch (ly:event-property (event-cause grob) 'pitch))
           (grob-index (ly:pitch-notename grob-pitch))
           (delta (modulo (- grob-index tonic-index) 7))
           (note-names
             (map
               (lambda (x)
                 (list->string
                   (list
                     (integer->char
                       (+ 1 delta (char->integer #\0))))))
              '(0 1 2 3 4 5 6))))
        (ly:grob-set-property! grob 'note-names (list->vector note-
names)))))))))


\layout {
  \context {
    \Voice
    \consists \ez-numbers-engraver
  }
}

\relative c' {
  \easyHeadsOn
  c d e f g a b c
  \key a \major
  a, b c d e f g a
  \key b \dorian
  b, c d e f g a b
}



2009: A year in review - http://www.tiscali.co.uk/2009





reply via email to

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