repair transposition for books

This commit is contained in:
tux
2024-05-25 13:14:14 +02:00
parent bce9ffe763
commit 0199813a81
4 changed files with 29 additions and 20 deletions

View File

@ -1,13 +1,22 @@
TRANSPOSITION = ##f
TRANSPOSITION = #(cons #f #f)
transposeGlobal =
#(define-void-function (from to) (ly:pitch? ly:pitch?)
(set! TRANSPOSITION (cons from to)))
transposable =
#(define-music-function (music) (ly:music?)
(if TRANSPOSITION
#(define-music-function (fromto music) (pair? ly:music?)
(if (car fromto)
#{
\transpose #(car TRANSPOSITION) #(cdr TRANSPOSITION) #music
\transpose #(car fromto) #(cdr fromto) #music
#}
music))
% 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))