Re: [frogs] Patch 35082c46e888dd991ce7b446d7d5108d057cf23e Numeric Noteheads Snippet

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]



>----Original Message----
>From: c_sorensen@xxxxxxx
>Date: 12/01/2010 19:18 
>To: "pounderd@xxxxxxxxxxx"<pounderd@xxxxxxxxxxx>, "frogs@xxxxxxxxxxx"
<frogs@xxxxxxxxxxx>
>Subj: Re: [frogs] Patch 35082c46e888dd991ce7b446d7d5108d057cf23e 
Numeric Noteheads Snippet
>
>David,
>
>I didn't see an attached patch.
>
>If you just want to add the snippet, and aren't changing any of the 
existing
>code, we should just get a .ly file, instead of a patch.
>
>Thanks,
>
>Carl
>

Sorry - I thought I had to add it to Documentation/snippets/new and 
run the makelsr.py script, rebuild the docs and then generate a patch?

It's a bit confusing. The ly file should be attached now. If not, 
there's something wrong with my mail.

David




2009: A year in review - http://www.tiscali.co.uk/2009
\version "2.13.11"

\header {
  lsrtags = "pitches"
  texidoc = "
Easy notation note heads use the @code{note-names} property
of the @code{notehead} object to determine what appears inside
the note head.  By overriding this property, it is possible
to print numbers representing the scale-degree.

A simple engraver can be created to do this for every notehead
object it sees.
"
  doctitle = "Numbers as easy noteheads"
}

#(define Ez_numbers_engraver (list
  (cons 'acknowledgers
   (list
     (cons 'note-head-interface
       (lambda (engraver grob source-engraver)
         (let* (
           (context (ly:translator-context engraver))
           (tonic-pitch (ly:context-property context 'tonic))
           (tonic-name (ly:pitch-notename tonic-pitch))
           (grob-pitch (ly:event-property (event-cause grob) 'pitch))
           (grob-name (ly:pitch-notename grob-pitch))
           (delta (modulo (- grob-name tonic-name) 7))
           (note-names (make-vector 7 (number->string (+ 1 delta)))))
        (ly:grob-set-property! grob 'note-names note-names))))))))

\layout {
  \context {
    \Voice
    \consists \Ez_numbers_engraver
  }
}

\relative c' {
  \easyHeadsOn
  c4 d e f
  g4 a b c \break

  \key a \major
  a,4 b cis d
  e4 fis gis a \break

  \key d \dorian
  d,4 e f g
  a4 b c d
}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/