lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:pitch and string


From: Simon Albrecht
Subject: Re: ly:pitch and string
Date: Sat, 11 Oct 2014 01:11:10 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

Hello again,

well, now I did try and make a function for german note names, which discerns major and minor also. Actually it works – the transposition is applied correctly and there are no unexpected messages – but at testing there seemed to be a memory problem: from some point onwards, the newTonicString was always "eses" regardless of the input. Perhaps the computer and I ought to go to sleep. (what a mad sentence that is…)
And thanks again for your input, Paul.

Best, Simon

Am 10.10.2014 um 23:55 schrieb Simon Albrecht:
Hello Paul,

thanks a lot! I thought along the same lines also, but (1) my less elegant coding and (2) the complications brought along by German notenames would’ve made it too tedious.

Am 10.10.2014 um 23:44 schrieb Paul Morris:
Just for fun, another version, more compact, probably more cryptic:

%%%%%%%%%%%%%%
\version "2.19.12"
If you were to make an LSR snippet, I’d suggest making a Dutch version pitch-to-string-dutch also (same for both coding variants):

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")
replace the latter list by '("eses" "es" "" "is" "isis")
       (+ 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' } }

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

Best regards, Simon

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

Attachment: pitch-to-key.ly
Description: Text document


reply via email to

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