Sorry, here's the correct function, without the debugging output:

sacredHarps = \applyContext #(lambda (c)
  (let* ((alts (ly:context-property c 'keySignature))
         (tonic (ly:context-property c 'tonic)))
    (if (ly:pitch? tonic)
      (begin
        (let* ((third (modulo (+ 2 (ly:pitch-notename tonic)) 7))
               (pitch (ly:make-pitch (ly:pitch-octave tonic) third (or
(ly:assoc-get third alts) NATURAL)))
               (diff (- (ly:pitch-semitones pitch) (ly:pitch-semitones tonic))))
          (if (or (eqv? diff 4) (eqv? diff -8))
            (ly:context-set-property! c 'shapeNoteStyles #(fa #f la fa
#f la mi))
            (ly:context-set-property! c 'shapeNoteStyles #(la mi fa #f
la fa #f)))
    )))
  ))


_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to