lilypond-user
[Top][All Lists]
Advanced

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

Re: Nashville notation as chord symbols


From: Amelie Zapf
Subject: Re: Nashville notation as chord symbols
Date: Wed, 17 Jun 2015 09:49:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Dear Paul, all,

thanks for your great contribution of passing the tonic as an argument.

> It’s possible to create a custom engraver (with scheme) that can access this 
> property and do something with it.  (There’s not all that much documentation 
> on this, but maybe look in the LSR for examples? “make-engraver” is the 
> function.)  I’m not sure how a custom engraver would work with chordRootNamer 
> and chordNoteNamer, just because I’m unfamiliar with the chord name 
> mechanisms.  

In the documentation, under 1.1.4 – Note heads – Easy notation, there is
a snippet printing the scale degree inside the note head. The
make-engraver code reads out the root and calculates the scale degree.
What's left now is to isolate this function and put it into the other
code we already have. Then Nashville chord symbol support will be
harmonically complete. What's left are the rhythmic markings, but that's
a whole different matter.

Regards,

Amy

#(define Ez_numbers_engraver
   (make-engraver
    (acknowledgers
     ((note-head-interface 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))))))

#(set-global-staff-size 26)

\layout {
  ragged-right = ##t
  \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
}
-- 
Dr. Amelie Zapf (address@hidden)
Pianist, Bassist, Guitarist, Composer, Friedrich-Ebert-Str. 25, 14548
Caputh, Germany
http://www.ameliezapf.com/
PGP public key ID: 4E0A7F00
"When the power of love overcomes the love of power, the world will know
peace." - Jimi Hendrix



reply via email to

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