%%%%%%%%%%%%%% \version "2.19.12" \language "deutsch" pitch-to-key-string-german = #(define-scheme-function (parser location p mode) (ly:pitch? string?) (let* ((major? (equal? mode "major")) (nn (ly:pitch-notename p)) (nn-string (if major? (list-ref '("C" "D" "E" "F" "G" "A" "H") nn) (list-ref '("c" "d" "e" "f" "g" "a" "h") nn))) (alt (ly:pitch-alteration p)) (alt-num (+ 2 (* 2 (ly:pitch-alteration p)))) (alt-string (list-ref '("eses" "es" "" "is" "isis") alt-num)) ;pitch without octave (na (cons nn alt)) ;helper function for exceptions in german note naming (exc (lambda (n a ma mi) ((equal? na (cons n a)) (if major? ma mi))))) (cond (exc 2 -1 "Eses" "eses") (exc 2 -1/2 "Es" "es") (exc 5 -1 "Asas" "asas") (exc 5 -1/2 "As" "as") (exc 6 -1/2 "B" "b") (else (string-append nn-string alt-string))))) newTonic = disis' newTonicString = \pitch-to-key-string-german \newTonic "major" % for testing: #(display (string-append "in-" newTonicString)) \bookOutputSuffix #(string-append "in-" newTonicString) \score { \transpose c \newTonic { c' } } %%%%%%%%%%%%%%