transposeGlobal kann ganzen Song transponieren

This commit is contained in:
tux 2023-08-07 16:24:43 +02:00
parent 8e6eff1cad
commit 19b5fe2d94
5 changed files with 23 additions and 1 deletions

View File

@ -12,9 +12,11 @@
\include "footer_with_songinfo.ly"
\include "auto_rest_merging.ly"
\include "chord_settings.ly"
\include "transposition.ly"
\include "verses_with_chords.ly"
\include "arrows_in_scores.ly"
\include "swing_style.ly"
\include "inline_score.ly"
% reset important variables
LAYOUT = \layout { \generalLayout }

5
inline_score.ly Normal file
View File

@ -0,0 +1,5 @@
inline-score =
#(define-music-function (music) (ly:music?)
#{
\transposable #music
#})

View File

@ -1,6 +1,8 @@
% set the speed of the midi music
#(define midiQuarterNoteSpeed (if (defined? 'midiQuarterNoteSpeed) midiQuarterNoteSpeed 90))
MUSIC = { \transposable \MUSIC }
% nur Output wenn noStandaloneOutput auf false steht
output = #(if (not noStandaloneOutput)
#{

13
transposition.ly Normal file
View File

@ -0,0 +1,13 @@
TRANSPOSITION = ##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
#{
\transpose #(car TRANSPOSITION) #(cdr TRANSPOSITION) #music
#}
music))

View File

@ -119,7 +119,7 @@
(regexp-substitute/global #f "\\(( *)([^,()]*)( *),([^)]*)\\)"
(regexp-substitute/global #f "(([^ \n]*\\([^()]*\\)[^ \n]*)+)" verse
'pre " \\concat { " 1 " } " 'post)
'pre "\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { " transp " \\chords { s4 " 4 " } \\layout { \\verseChordLayout } }" 'post))
'pre "\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { \\transposable " transp " \\chords { s4 " 4 " } \\layout { \\verseChordLayout } }" 'post))
))))
% Kompletter Vers aus dem Akkorde entfernt werden