lilypond-common-includes/transposition.ly

23 lines
689 B
Plaintext
Raw Normal View History

2024-05-25 13:14:14 +02:00
TRANSPOSITION = #(cons #f #f)
transposeGlobal =
#(define-void-function (from to) (ly:pitch? ly:pitch?)
(set! TRANSPOSITION (cons from to)))
transposable =
2024-05-25 13:14:14 +02:00
#(define-music-function (fromto music) (pair? ly:music?)
(if (car fromto)
#{
2024-05-25 13:14:14 +02:00
\transpose #(car fromto) #(cdr fromto) #music
#}
music))
2024-05-25 13:14:14 +02:00
% Akkorde in Strophen transponieren
#(define-markup-list-command (transpose layout props from to markuplist)
(markup? markup? markup-list?)
(define (markup->pitch m)
(ly:assoc-get (string->symbol (markup->string m)) pitchnames))
(interpret-markup-list layout (prepend-alist-chain 'transposition (cons (markup->pitch from) (markup->pitch to)) props) markuplist))