lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:pitch and string


From: Paul Morris
Subject: Re: ly:pitch and string
Date: Fri, 10 Oct 2014 14:44:58 -0700 (PDT)

Just for fun, another version, more compact, probably more cryptic:

%%%%%%%%%%%%%%
\version "2.19.12"

pitch-to-string =
#(define-scheme-function (parser location p) (ly:pitch?)
   (string-append
    (list-ref '("C" "D" "E" "F" "G" "A" "B") 
      (ly:pitch-notename p))
    (list-ref '("-Double-Flat" "-Flat" "" "-Sharp" "-Double-Sharp") 
      (+ 2 (* 2 (ly:pitch-alteration p))))))

newTonic = d

newTonicString = \pitch-to-string \newTonic

% for testing:
#(display (string-append "in-" newTonicString))

\bookOutputSuffix #(string-append "in-" newTonicString)

\score { \transpose c \newTonic { c' } }

%%%%%%%%%%%%%%




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/ly-pitch-and-string-tp167397p167405.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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