Compare commits
4 Commits
5364f93db4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c92c65c82 | |||
| b2f1a7dc86 | |||
| 893010c4a9 | |||
| 8aa0e3fdc3 |
@@ -72,6 +72,8 @@ generalLayout = \layout {
|
|||||||
\override Stem.layer = 2
|
\override Stem.layer = 2
|
||||||
\override Flag.layer = 2
|
\override Flag.layer = 2
|
||||||
\override Beam.layer = 2
|
\override Beam.layer = 2
|
||||||
|
\override Slur.layer = 2
|
||||||
|
\override Tie.layer = 2
|
||||||
\override Accidental.layer = 2
|
\override Accidental.layer = 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,6 +91,8 @@ secondVoiceStyle = {
|
|||||||
\override Stem.color = #grey
|
\override Stem.color = #grey
|
||||||
\override Flag.color = #grey
|
\override Flag.color = #grey
|
||||||
\override Beam.color = #grey
|
\override Beam.color = #grey
|
||||||
|
\override Slur.color = #grey
|
||||||
|
\override Tie.color = #grey
|
||||||
\override Accidental.color = #grey
|
\override Accidental.color = #grey
|
||||||
\override NoteHead.layer = 1
|
\override NoteHead.layer = 1
|
||||||
\override Rest.layer = 1
|
\override Rest.layer = 1
|
||||||
@@ -96,6 +100,8 @@ secondVoiceStyle = {
|
|||||||
\override Stem.layer = 1
|
\override Stem.layer = 1
|
||||||
\override Flag.layer = 1
|
\override Flag.layer = 1
|
||||||
\override Beam.layer = 1
|
\override Beam.layer = 1
|
||||||
|
\override Slur.layer = 1
|
||||||
|
\override Tie.layer = 1
|
||||||
\override Accidental.layer = 1
|
\override Accidental.layer = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +112,8 @@ firstVoiceStyle = {
|
|||||||
\override Stem.color = #black
|
\override Stem.color = #black
|
||||||
\override Flag.color = #black
|
\override Flag.color = #black
|
||||||
\override Beam.color = #black
|
\override Beam.color = #black
|
||||||
|
\override Slur.color = #black
|
||||||
|
\override Tie.color = #black
|
||||||
\override Accidental.color = #black
|
\override Accidental.color = #black
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,23 +127,23 @@ romanStanza =
|
|||||||
#{ \override StanzaNumber.style = #'roman #})
|
#{ \override StanzaNumber.style = #'roman #})
|
||||||
|
|
||||||
override-stanza =
|
override-stanza =
|
||||||
#(define-music-function (parser location stanzanumber) (number?)
|
#(define-music-function (parser location stanzanumbers) (number-list?)
|
||||||
#{
|
#{
|
||||||
\once \override StanzaNumber.forced-spacing = #stanzanumber % misuse property "forced-spacing" to override the stanzanumber
|
\once \override StanzaNumber.details.custom-stanzanumber-override = #stanzanumbers
|
||||||
#}
|
#}
|
||||||
)
|
)
|
||||||
|
|
||||||
#(define (stanza . stanzanumbers)
|
#(define (stanza . stanzanumbers)
|
||||||
#{
|
#{
|
||||||
\once \override StanzaNumber.layer = 23 % set this to signal that there is a real stanza and no repeat signs
|
\once \override StanzaNumber.details.custom-realstanza = ##t % set this to signal that there is a real stanza and no repeat signs
|
||||||
\applyContext
|
\applyContext
|
||||||
#(lambda (context)
|
#(lambda (context)
|
||||||
(let* ((stanzanumber-override (ly:assoc-get 'forced-spacing (ly:context-grob-definition context 'StanzaNumber) #f))
|
(let* ((stanzanumbers-override (ly:assoc-get 'custom-stanzanumber-override (ly:assoc-get 'details (ly:context-grob-definition context 'StanzaNumber) '()) #f))
|
||||||
(stanza-style (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber)))
|
(stanza-style (ly:assoc-get 'style (ly:context-grob-definition context 'StanzaNumber)))
|
||||||
(stanza-format (lambda (stanzanumber) (format #f (if (eq? stanza-style 'roman) romanStanzaFormat stanzaFormat) stanzanumber))))
|
(stanza-format (lambda (stanzanumber) (format #f (if (eq? stanza-style 'roman) romanStanzaFormat stanzaFormat) stanzanumber))))
|
||||||
(ly:context-set-property! context 'stanza
|
(ly:context-set-property! context 'stanza
|
||||||
(string-join (map stanza-format
|
(string-join (map stanza-format
|
||||||
(if stanzanumber-override (list stanzanumber-override) stanzanumbers))
|
(if stanzanumbers-override stanzanumbers-override stanzanumbers))
|
||||||
", "))))
|
", "))))
|
||||||
#}
|
#}
|
||||||
)
|
)
|
||||||
@@ -143,7 +151,7 @@ override-stanza =
|
|||||||
ref =
|
ref =
|
||||||
#(define-music-function (stanzanumbers lyrics) ((number-list? (list)) ly:music?)
|
#(define-music-function (stanzanumbers lyrics) ((number-list? (list)) ly:music?)
|
||||||
#{ \lyricmode {
|
#{ \lyricmode {
|
||||||
\once \override StanzaNumber.layer = 23 % set this to signal that there is a real stanza and no repeat signs
|
\once \override StanzaNumber.details.custom-realstanza = ##t % set this to signal that there is a real stanza and no repeat signs
|
||||||
\set stanza = #(make-on-the-fly-markup (lambda (layout props m) ((ly:output-def-lookup layout 'refMarkupFormatter) layout props stanzanumbers)) (make-null-markup))
|
\set stanza = #(make-on-the-fly-markup (lambda (layout props m) ((ly:output-def-lookup layout 'refMarkupFormatter) layout props stanzanumbers)) (make-null-markup))
|
||||||
#lyrics
|
#lyrics
|
||||||
}
|
}
|
||||||
@@ -151,13 +159,13 @@ ref =
|
|||||||
)
|
)
|
||||||
|
|
||||||
% prints a repStart Sign as stanza if the tag 'repeats is kept.
|
% prints a repStart Sign as stanza if the tag 'repeats is kept.
|
||||||
% if there was a stanza already set by the stanza function with StanzaNumber.layer = 23 we set that also as stanza.
|
% if there was a stanza already set by the stanza function with StanzaNumber.details.custom-realstanza = ##t we set that also as stanza.
|
||||||
repStartWithTag = \lyricmode {
|
repStartWithTag = \lyricmode {
|
||||||
\tag #'repeats {
|
\tag #'repeats {
|
||||||
\applyContext
|
\applyContext
|
||||||
#(lambda (context)
|
#(lambda (context)
|
||||||
(let ((lastStanza (ly:context-property context 'stanza))
|
(let ((lastStanza (ly:context-property context 'stanza))
|
||||||
(printLastStanza (= (ly:assoc-get 'layer (ly:context-grob-definition context 'StanzaNumber) 0) 23))
|
(printLastStanza (ly:assoc-get 'custom-realstanza (ly:assoc-get 'details (ly:context-grob-definition context 'StanzaNumber) '()) #f))
|
||||||
(stanzaFontSeries (ly:assoc-get 'font-series (ly:context-grob-definition context 'StanzaNumber) 'normal)))
|
(stanzaFontSeries (ly:assoc-get 'font-series (ly:context-grob-definition context 'StanzaNumber) 'normal)))
|
||||||
(ly:context-set-property! context 'stanza
|
(ly:context-set-property! context 'stanza
|
||||||
(make-concat-markup
|
(make-concat-markup
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
(lambda (paragraph)
|
(lambda (paragraph)
|
||||||
(make-wordwrap-internal-markup-list #t
|
(make-wordwrap-internal-markup-list #t
|
||||||
#{ \markuplist { $(ly:parser-include-string paragraph) } #}))
|
#{ \markuplist { $(ly:parser-include-string paragraph) } #}))
|
||||||
(ly:regex-split (ly:make-regex "\n[ \t\n]*\n[ \t\n]*") (string-append prefix text))))
|
(ly:regex-split (ly:make-regex "\r?\n[ \t\r\n]*\n[ \t\r\n]*") (string-append prefix text))))
|
||||||
'())))
|
'())))
|
||||||
(poet-and-composer-markup-list
|
(poet-and-composer-markup-list
|
||||||
(string-with-paragraphs->markuplist "" (string-append
|
(string-with-paragraphs->markuplist "" (string-append
|
||||||
|
|||||||
@@ -61,20 +61,9 @@
|
|||||||
;; We insert index items sorted from the beginning on and do
|
;; We insert index items sorted from the beginning on and do
|
||||||
;; not sort them later - this saves pretty much computing time
|
;; not sort them later - this saves pretty much computing time
|
||||||
(insert-alphabetical-sorted! (list label markup-symbol textoptions
|
(insert-alphabetical-sorted! (list label markup-symbol textoptions
|
||||||
;; this crazy hack is necessary because lilypond depends on guile 1.8 atm
|
|
||||||
;; and so the cool unicode conversion functions cannot be used
|
|
||||||
(ly:string-substitute " " ""
|
(ly:string-substitute " " ""
|
||||||
(ly:string-substitute "…" ""
|
(ly:string-substitute "." ""
|
||||||
(ly:string-substitute "Č" "C"
|
(transliterate-de sorttext))))
|
||||||
(ly:string-substitute "Đ" "D"
|
|
||||||
(ly:string-substitute "Š" "S"
|
|
||||||
(ly:string-substitute "Т" "T"
|
|
||||||
(ly:string-substitute "Ä" "Ae"
|
|
||||||
(ly:string-substitute "ä" "ae"
|
|
||||||
(ly:string-substitute "Ö" "O"
|
|
||||||
(ly:string-substitute "ö" "oe"
|
|
||||||
(ly:string-substitute "Ü" "U"
|
|
||||||
(ly:string-substitute "ü" "ue" sorttext)))))))))))))
|
|
||||||
index-item-list))
|
index-item-list))
|
||||||
(make-music 'EventChord
|
(make-music 'EventChord
|
||||||
'page-marker #t
|
'page-marker #t
|
||||||
|
|||||||
65
private_includes/book/transliteration.ily
Normal file
65
private_includes/book/transliteration.ily
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
#(define (transliterate-de str)
|
||||||
|
"Gesamte Transliteration: entfernt Diakritika, ersetzt Sonderzeichen, ergibt ASCII-String."
|
||||||
|
|
||||||
|
(define (remove-diacritics s)
|
||||||
|
(string-join
|
||||||
|
(map (lambda (ch)
|
||||||
|
(let ((code (char->integer ch)))
|
||||||
|
;; Unicode-Bereich 0300–036F = Combining Diacritical Marks
|
||||||
|
(if (and (>= code #x0300) (<= code #x036F))
|
||||||
|
""
|
||||||
|
(string ch))))
|
||||||
|
(string->list (string-normalize-nfkd s)))
|
||||||
|
""))
|
||||||
|
|
||||||
|
(define transliteration-table
|
||||||
|
'(
|
||||||
|
;; Deutsche Umlaute & ß
|
||||||
|
("ä" . "ae") ("ö" . "oe") ("ü" . "ue")
|
||||||
|
("Ä" . "Ae") ("Ö" . "Oe") ("Ü" . "Ue")
|
||||||
|
("ß" . "ss")
|
||||||
|
|
||||||
|
;; Balkan & mitteleuropäische Sonderzeichen
|
||||||
|
("Č" . "C") ("č" . "c")
|
||||||
|
("Š" . "S") ("š" . "s")
|
||||||
|
("Ž" . "Z") ("ž" . "z")
|
||||||
|
("Đ" . "D") ("đ" . "d")
|
||||||
|
("Ł" . "L") ("ł" . "l")
|
||||||
|
("Ø" . "O") ("ø" . "o")
|
||||||
|
("Æ" . "Ae") ("æ" . "ae")
|
||||||
|
("Œ" . "Oe") ("œ" . "oe")
|
||||||
|
|
||||||
|
;; Kyrillische Buchstaben mit lateinischen Pendants
|
||||||
|
("А" . "A") ("а" . "a")
|
||||||
|
("Б" . "B") ("б" . "b")
|
||||||
|
("В" . "V") ("в" . "v")
|
||||||
|
("Г" . "G") ("г" . "g")
|
||||||
|
("Д" . "D") ("д" . "d")
|
||||||
|
("Е" . "E") ("е" . "e")
|
||||||
|
("З" . "Z") ("з" . "z")
|
||||||
|
("И" . "I") ("и" . "i")
|
||||||
|
("К" . "K") ("к" . "k")
|
||||||
|
("Л" . "L") ("л" . "l")
|
||||||
|
("М" . "M") ("м" . "m")
|
||||||
|
("Н" . "N") ("н" . "n")
|
||||||
|
("О" . "O") ("о" . "o")
|
||||||
|
("П" . "P") ("п" . "p")
|
||||||
|
("Р" . "R") ("р" . "r")
|
||||||
|
("С" . "S") ("с" . "s")
|
||||||
|
("Т" . "T") ("т" . "t")
|
||||||
|
("У" . "U") ("у" . "u")
|
||||||
|
("Ф" . "F") ("ф" . "f")
|
||||||
|
("Х" . "Kh") ("х" . "kh")
|
||||||
|
("Ц" . "Ts") ("ц" . "ts")
|
||||||
|
("Ч" . "Ch") ("ч" . "ch")
|
||||||
|
("Ш" . "Sh") ("ш" . "sh")
|
||||||
|
("Щ" . "Sch") ("щ" . "sch")
|
||||||
|
("Я" . "Ja") ("я" . "ja")
|
||||||
|
("Ю" . "Ju") ("ю" . "ju")
|
||||||
|
("Й" . "J") ("й" . "j")
|
||||||
|
))
|
||||||
|
|
||||||
|
(remove-diacritics
|
||||||
|
(fold (lambda (pair acc)
|
||||||
|
(ly:string-substitute (car pair) (cdr pair) acc))
|
||||||
|
str transliteration-table)))
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
\include "../private_includes/book/book_include.ily"
|
\include "../private_includes/book/book_include.ily"
|
||||||
|
\include "../private_includes/book/transliteration.ily"
|
||||||
\include "../private_includes/book/toc_include.ily"
|
\include "../private_includes/book/toc_include.ily"
|
||||||
\include "../private_includes/book/appendix.ily"
|
\include "../private_includes/book/appendix.ily"
|
||||||
Reference in New Issue
Block a user