|
From: | David Nalesnik |
Subject: | Re: Programming Question |
Date: | Thu, 18 Sep 2014 15:03:41 -0500 |
Is this the way I enter it? For some reason, does not seem to be working
- it seems to be ignoring the suffix.
If I wanted to display new-name as the program runs, is there a command
for that?
Thanks
Jay
\version "2.18.2"
music = \relative c' {c2 d e f g a b c c b a g f e d c}
newnames =
#`(("c" . "S")
("d" . "R")
("e" . "G")
("f" . "M")
("g" . "P")
("a" . "D")
("b" . "N")
)
#(define (myNoteNames size)
(lambda (grob)
(let* (
;; bindings
(default-name (ly:grob-property grob 'text))
(new-name (assoc-get default-name newnames))
(cause (event-cause grob))
(duration (ly:prob-property cause 'duration))
(duration-log (ly:duration-log duration))
(suffix
(case duration-log
((1) "a") ;; half note
(else "")))
(text (string-append new-name suffix))
)
;; body
(ly:grob-set-property! grob 'text (markup #:fontsize size new-
name))
(ly:text-interface::print grob)
)
))
[Prev in Thread] | Current Thread | [Next in Thread] |