Compare commits
1 Commits
9de2869750
...
tocSubtitl
Author | SHA1 | Date | |
---|---|---|---|
db57e6d5c4 |
@ -8,16 +8,6 @@ klamm = #(define-music-function (parser location chords) (ly:music?)
|
|||||||
\set chordNameFunction = #ignatzek-chord-names
|
\set chordNameFunction = #ignatzek-chord-names
|
||||||
#})
|
#})
|
||||||
|
|
||||||
repeats-around-chords =
|
|
||||||
#(define-music-function (parser location chords) (ly:music?)
|
|
||||||
#{
|
|
||||||
\once \set noChordSymbol = \markup { \normal-text \repStart }
|
|
||||||
r4
|
|
||||||
$chords
|
|
||||||
\once \set noChordSymbol = \markup { \normal-text \repStop }
|
|
||||||
r4
|
|
||||||
#})
|
|
||||||
|
|
||||||
bchord =
|
bchord =
|
||||||
#(define-music-function (parser location chords) (ly:music?)
|
#(define-music-function (parser location chords) (ly:music?)
|
||||||
#{
|
#{
|
||||||
@ -81,7 +71,7 @@ generalLayout = \layout {
|
|||||||
\semiGermanChords
|
\semiGermanChords
|
||||||
\override ChordName.font-size = \songScoreChordFontSize
|
\override ChordName.font-size = \songScoreChordFontSize
|
||||||
\override ChordName.font-series = \songChordFontSeries
|
\override ChordName.font-series = \songChordFontSeries
|
||||||
\override ChordName.font-family = #'serif
|
\override ChordName.font-family = #'sans
|
||||||
chordNameLowercaseMinor = ##t
|
chordNameLowercaseMinor = ##t
|
||||||
chordChanges = ##t
|
chordChanges = ##t
|
||||||
% eigenen chordRootNamer damit F# = Fis und Gb = Ges (also alteration ausgeschrieben)
|
% eigenen chordRootNamer damit F# = Fis und Gb = Ges (also alteration ausgeschrieben)
|
||||||
@ -94,6 +84,14 @@ generalLayout = \layout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verseChordLayout = \layout {
|
||||||
|
\generalLayout
|
||||||
|
\context {
|
||||||
|
\ChordNames
|
||||||
|
\override ChordName.font-size = \songTextChordFontSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
% Akkord mit Bunddiagramm anzeigen
|
% Akkord mit Bunddiagramm anzeigen
|
||||||
#(define-markup-command (fret-chord layout props fret chord) (string? string?)
|
#(define-markup-command (fret-chord layout props fret chord) (string? string?)
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
|
@ -3,15 +3,6 @@
|
|||||||
|
|
||||||
MUSIC = { \transposable \MUSIC }
|
MUSIC = { \transposable \MUSIC }
|
||||||
|
|
||||||
verselayout = \layout {
|
|
||||||
\LAYOUT
|
|
||||||
\context {
|
|
||||||
\ChordNames
|
|
||||||
\override ChordName.font-size = \songTextChordFontSize
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TEXT = \markuplist { \override #`(verselayout . verselayout) \TEXT }
|
|
||||||
|
|
||||||
% nur Output wenn noStandaloneOutput auf false steht
|
% nur Output wenn noStandaloneOutput auf false steht
|
||||||
output = #(if (not noStandaloneOutput)
|
output = #(if (not noStandaloneOutput)
|
||||||
#{
|
#{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
\include "../lilypond-custom-includes/toc_config.ly"
|
||||||
|
|
||||||
% embed all category images in postscript once
|
% embed all category images in postscript once
|
||||||
#(define-markup-list-command (embed-category-images layout props)()
|
#(define-markup-list-command (embed-category-images layout props)()
|
||||||
(map (lambda (category)
|
(map (lambda (category)
|
||||||
@ -171,6 +173,11 @@
|
|||||||
(cdr revlist)))))))))
|
(cdr revlist)))))))))
|
||||||
|
|
||||||
\paper {
|
\paper {
|
||||||
|
indexTitleMarkup = \tocSubtitleText
|
||||||
|
categoryTitleMarkup = \markup \column {
|
||||||
|
\fontsize #5 \sans \bold \fill-line { \null \fromproperty #'index:text \null }
|
||||||
|
\vspace #1
|
||||||
|
}
|
||||||
indexItemMarkup = \markup \with-link-symbol-ref #'index:label {
|
indexItemMarkup = \markup \with-link-symbol-ref #'index:label {
|
||||||
\index-item-with-pattern
|
\index-item-with-pattern
|
||||||
}
|
}
|
||||||
@ -184,7 +191,29 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
%{
|
||||||
|
#(define-markup-list-command (index layout props) ()
|
||||||
|
( _i "Outputs an alphabetical sorted index, using the paper
|
||||||
|
variable @code{indexTitleMarkup} for its title, then the list of
|
||||||
|
lines built using the @code{indexItem} music function
|
||||||
|
Usage: @code{\\markuplines \\index}" )
|
||||||
|
(cons (interpret-markup layout (cons (list (cons 'index:text "Inhaltsverzeichnis")) props)
|
||||||
|
(ly:output-def-lookup layout 'indexTitleMarkup))
|
||||||
|
(space-lines (chain-assoc-get 'baseline-skip props)
|
||||||
|
(map (lambda (index-item)
|
||||||
|
(let ((label (car index-item))
|
||||||
|
(index-markup (cadr index-item))
|
||||||
|
(text (caddr index-item)))
|
||||||
|
(interpret-markup
|
||||||
|
layout
|
||||||
|
(cons (list (cons 'index:page
|
||||||
|
(markup #:page-ref label "XXX" "?"))
|
||||||
|
(cons 'index:text text)
|
||||||
|
(cons 'index:label label))
|
||||||
|
props)
|
||||||
|
(ly:output-def-lookup layout index-markup))))
|
||||||
|
(index-items)))))
|
||||||
|
%}
|
||||||
#(define (prepare-item-markup items layout)
|
#(define (prepare-item-markup items layout)
|
||||||
(map (lambda (index-item)
|
(map (lambda (index-item)
|
||||||
(let ((label (car index-item))
|
(let ((label (car index-item))
|
||||||
@ -196,18 +225,33 @@
|
|||||||
(ly:output-def-lookup layout index-markup))))
|
(ly:output-def-lookup layout index-markup))))
|
||||||
(items)))
|
(items)))
|
||||||
|
|
||||||
#(define-markup-list-command (index-in-columns-with-title layout props index-type title-markup) (symbol? markup?)
|
|
||||||
( _i "Outputs index alphabetical sorted or in categories" )
|
#(define-markup-list-command (colindex layout props) ()
|
||||||
(let ((items (case index-type
|
( _i "Outputs an alphabetical sorted index, using the paper
|
||||||
((alphabetical) index-items)
|
variable @code{indexTitleMarkup} for its title, then the list of
|
||||||
((categories) category-index-items)))
|
lines built using the @code{indexItem} music function
|
||||||
(title (interpret-markup layout props title-markup)))
|
Usage: @code{\\markuplines \\index}" )
|
||||||
|
(let ((title (interpret-markup layout (cons (list (cons 'index:text "Inhaltsverzeichnis")) props)
|
||||||
|
(ly:output-def-lookup layout 'indexTitleMarkup))))
|
||||||
(cons title
|
(cons title
|
||||||
(interpret-markup-list layout props
|
(interpret-markup-list layout props
|
||||||
(make-columnlayout-markup-list songTocColumns 2
|
(make-columnlayout-markup-list songTocColumns 2
|
||||||
(let ((h (- (ly:output-def-lookup layout 'paper-height) 12)))
|
(let ((h (- (ly:output-def-lookup layout 'paper-height) 12)))
|
||||||
(cons (- h (interval-length (ly:stencil-extent title Y))) h))
|
(cons (- h (interval-length (ly:stencil-extent title Y))) h))
|
||||||
(prepare-item-markup items layout))))))
|
(prepare-item-markup index-items layout))))))
|
||||||
|
|
||||||
|
#(define-markup-list-command (categoryindex layout props) ()
|
||||||
|
( _i "Outputs categorized song titles" )
|
||||||
|
(if (null-list? (category-index-items))
|
||||||
|
(list)
|
||||||
|
(let ((title (interpret-markup layout (cons (list (cons 'index:text "Inhaltsverzeichnis nach Kategorien")) props)
|
||||||
|
(ly:output-def-lookup layout 'categoryTitleMarkup))))
|
||||||
|
(cons title
|
||||||
|
(interpret-markup-list layout props
|
||||||
|
(make-columnlayout-markup-list songTocColumns 2
|
||||||
|
(let ((h (- (ly:output-def-lookup layout 'paper-height) 12)))
|
||||||
|
(cons (- h (interval-length (ly:stencil-extent title Y))) h))
|
||||||
|
(prepare-item-markup category-index-items layout)))))))
|
||||||
|
|
||||||
indexItem =
|
indexItem =
|
||||||
#(define-music-function (parser location sorttext text) (string? markup?)
|
#(define-music-function (parser location sorttext text) (string? markup?)
|
||||||
@ -219,6 +263,18 @@ indexSection =
|
|||||||
"Add a section line to the alphabetical index, using @code{indexSectionMarkup} paper variable markup. This can be used to divide the alphabetical index into different sections, for example one section for each first letter."
|
"Add a section line to the alphabetical index, using @code{indexSectionMarkup} paper variable markup. This can be used to divide the alphabetical index into different sections, for example one section for each first letter."
|
||||||
(add-index-item! 'indexSectionMarkup text sorttext))
|
(add-index-item! 'indexSectionMarkup text sorttext))
|
||||||
|
|
||||||
|
%{
|
||||||
|
addTitleToTOC = #(define-music-function (parser location title) (string?)
|
||||||
|
#{
|
||||||
|
\indexItem #title \markup { #title }
|
||||||
|
#})
|
||||||
|
|
||||||
|
addAltTitleToTOC = #(define-music-function (parser location title) (string?)
|
||||||
|
#{
|
||||||
|
\indexItem #title \markup { \italic #title }
|
||||||
|
#})
|
||||||
|
%}
|
||||||
|
|
||||||
#(define (extract-var-from-module module sym)
|
#(define (extract-var-from-module module sym)
|
||||||
(let ((variableref (assoc-ref module sym)))
|
(let ((variableref (assoc-ref module sym)))
|
||||||
(if variableref (variable-ref variableref) #f))
|
(if variableref (variable-ref variableref) #f))
|
||||||
|
@ -66,18 +66,17 @@
|
|||||||
% Text über Text mittig darstellen
|
% Text über Text mittig darstellen
|
||||||
#(define-markup-command (textup layout props text uptext) (markup? markup?)
|
#(define-markup-command (textup layout props text uptext) (markup? markup?)
|
||||||
"Markup über Text mittig darstellen."
|
"Markup über Text mittig darstellen."
|
||||||
(let ((verselayout (chain-assoc-get 'verselayout props generalLayout)))
|
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
#{\markup {
|
#{\markup {
|
||||||
\size-box-to-box-style-dependent ##t ##f
|
\size-box-to-box-style-dependent ##t ##f
|
||||||
\general-align #X #LEFT \override #`(direction . ,UP) \override #'(baseline-skip . 1.0) \dir-column \chord-alignment-style-dependent {
|
\general-align #X #LEFT \override #`(direction . ,UP) \override #'(baseline-skip . 1.0) \dir-column \chord-alignment-style-dependent {
|
||||||
\pad-to-box #'(0 . 0) #'(0 . 2.0) { #text }
|
\pad-to-box #'(0 . 0) #'(0 . 2.0) { #text }
|
||||||
\size-box-to-box ##f ##t #uptext \score { \chords { g4:m a } \layout { \verselayout } }
|
\size-box-to-box ##f ##t #uptext \score { \chords { g4:m a } \layout { \generalLayout } }
|
||||||
}
|
}
|
||||||
#text
|
#text
|
||||||
}
|
}
|
||||||
#}
|
#}
|
||||||
)))
|
))
|
||||||
|
|
||||||
#(define-markup-command (anchor-x-between layout props arga argb)
|
#(define-markup-command (anchor-x-between layout props arga argb)
|
||||||
(markup? markup?)
|
(markup? markup?)
|
||||||
@ -89,60 +88,43 @@
|
|||||||
|
|
||||||
#(define-markup-command (stanza-raw layout props arg)
|
#(define-markup-command (stanza-raw layout props arg)
|
||||||
(markup?)
|
(markup?)
|
||||||
(let ((verselayout (chain-assoc-get 'verselayout props generalLayout)))
|
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
(if (and (string? arg) (string-null? arg))
|
(if (and (string? arg) (string-null? arg))
|
||||||
" "
|
" "
|
||||||
#{\markup
|
#{\markup
|
||||||
\score { \new Lyrics { \lyricmode { \set stanza = #arg "" } } \layout { \verselayout } }
|
\score { \new Lyrics { \lyricmode { \set stanza = #arg "" } } \layout { \generalLayout } }
|
||||||
#}
|
#}
|
||||||
))))
|
)))
|
||||||
|
|
||||||
#(define-markup-command (stanza layout props arg)
|
#(define-markup-command (stanza layout props arg)
|
||||||
(markup?)
|
(markup?)
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
(make-size-box-to-box-markup #f #t (make-stanza-raw-markup arg) (make-stanza-raw-markup "x"))))
|
(make-size-box-to-box-markup #f #t (make-stanza-raw-markup arg) (make-stanza-raw-markup "x"))))
|
||||||
|
|
||||||
#(define (handle-custom-newlines custom-verse-breaks text)
|
|
||||||
(if (null? custom-verse-breaks)
|
|
||||||
text
|
|
||||||
(let make-custom-linebreaks
|
|
||||||
((break-words custom-verse-breaks)
|
|
||||||
(newtext (ly:regex-replace (ly:make-regex "\n") text " ")))
|
|
||||||
(if (null? break-words)
|
|
||||||
newtext
|
|
||||||
(make-custom-linebreaks
|
|
||||||
(cdr break-words)
|
|
||||||
(ly:regex-replace
|
|
||||||
(ly:make-regex (string-append "(" (ly:regex-replace (ly:make-regex "(.)") (car break-words) "(?:\\(?" 1 "| *,[^,)]+\\)" 1 ")") "(?: *,[^,)]+\\))?)(.*)$"))
|
|
||||||
newtext
|
|
||||||
1 "\n" 2))))))
|
|
||||||
|
|
||||||
% Kompletten Vers mit Akkorden
|
% Kompletten Vers mit Akkorden
|
||||||
#(define-markup-command (chordverse layout props stanza verse) (markup? string?)
|
#(define-markup-command (chordverse layout props stanza verse) (markup? string?)
|
||||||
#:properties ((intraverse-vspace 0)(custom-verse-breaks '()))
|
#:properties ((intraverse-vspace 0))
|
||||||
"Vers mit Akkorden"
|
"Vers mit Akkorden"
|
||||||
(let* ((fromto (chain-assoc-get 'transposition props #f))
|
(let* ((fromto (chain-assoc-get 'transposition props #f))
|
||||||
(transp (if fromto
|
(transp (if fromto
|
||||||
(string-append "\\transpose " (car fromto) " " (cdr fromto))
|
(string-append "\\transpose " (car fromto) " " (cdr fromto))
|
||||||
""))
|
"")))
|
||||||
(verselayout (chain-assoc-get 'verselayout props generalLayout)))
|
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
(markup #:override `(baseline-skip . ,(+ intraverse-vspace songTextLineHeigth)) #:anchor-x-between #:stanza stanza
|
(markup #:override `(baseline-skip . ,(+ intraverse-vspace songTextLineHeigth)) #:anchor-x-between #:stanza stanza
|
||||||
(make-wrap-newline-markup
|
(make-wrap-newline-markup
|
||||||
(ly:regex-replace (ly:make-regex "\\(( *)([^,()]*)( *),([^)]*)\\)")
|
(ly:regex-replace (ly:make-regex "\\(( *)([^,()]*)( *),([^)]*)\\)")
|
||||||
(ly:regex-replace (ly:make-regex "(([^ \n]*\\([^()]*,[^()]+\\)[^ \n(]*)+)") (handle-custom-newlines custom-verse-breaks verse) " \\concat { " 1 " } ")
|
(ly:regex-replace (ly:make-regex "(([^ \n]*\\([^()]*,[^()]+\\)[^ \n(]*)+)") verse " \\concat { " 1 " } ")
|
||||||
"\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { \\transposable " transp " \\chords { s4 " 4 " } \\layout { \\verselayout } }")
|
"\\textup \\line { \"" 1 "\" " 2 " \"" 3 "\" } \\score { \\transposable " transp " \\chords { s4 " 4 " } \\layout { \\verseChordLayout } }")
|
||||||
)
|
)
|
||||||
))))
|
))))
|
||||||
|
|
||||||
% Kompletter Vers aus dem Akkorde entfernt werden
|
% Kompletter Vers aus dem Akkorde entfernt werden
|
||||||
#(define-markup-command (nochordverse layout props stanza verse) (markup? string?)
|
#(define-markup-command (nochordverse layout props stanza verse) (markup? string?)
|
||||||
#:properties ((intraverse-vspace 0)(custom-verse-breaks '()))
|
#:properties ((intraverse-vspace 0))
|
||||||
"Vers ohne Akkorde"
|
"Vers ohne Akkorde"
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
(markup #:override `(baseline-skip . ,(+ intraverse-vspace 3.0)) #:anchor-x-between #:stanza stanza
|
(markup #:override `(baseline-skip . ,(+ intraverse-vspace 3.0)) #:anchor-x-between #:stanza stanza
|
||||||
#:wrap-newline (ly:regex-replace (ly:make-regex "\\(([^,]*),([^)]*)\\)") (handle-custom-newlines custom-verse-breaks verse) 1)
|
#:wrap-newline (ly:regex-replace (ly:make-regex "\\(([^,]*),([^)]*)\\)") verse 1)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -160,25 +142,26 @@
|
|||||||
(verse-hspace 1)
|
(verse-hspace 1)
|
||||||
(verse-ordering-horizontal #f))
|
(verse-ordering-horizontal #f))
|
||||||
"Gruppiere Strophen in einem Markup auf Wunsch spaltenweise"
|
"Gruppiere Strophen in einem Markup auf Wunsch spaltenweise"
|
||||||
(define (add-markup-between-elements reverses markup-between elements)
|
(let ((h (make-hash-table verse-cols))
|
||||||
((if reverses fold fold-right) (lambda (element filled-list)
|
(index 0)
|
||||||
(cons element (if (null? filled-list) '() (cons markup-between filled-list))))
|
(column-item-count (ceiling (/ (length versegroup) verse-cols))))
|
||||||
'() elements))
|
(for-each (lambda (el)
|
||||||
(let* ((column-item-count (ceiling (/ (length versegroup) verse-cols)))
|
(let ((i (if verse-ordering-horizontal
|
||||||
(column-data (make-list verse-cols)))
|
|
||||||
(let columnize-list ((index 0) (items versegroup))
|
|
||||||
(if (not (null? items))
|
|
||||||
(let* ((column-index (if verse-ordering-horizontal
|
|
||||||
(modulo index verse-cols)
|
(modulo index verse-cols)
|
||||||
(floor (/ index column-item-count))))
|
(floor (/ index column-item-count)))))
|
||||||
(column-markups (list-ref column-data column-index)))
|
(hashv-set! h i (cons el (hashv-ref h i (list)))) (set! index (+ index 1))))
|
||||||
(list-set! column-data column-index (cons (car items) column-markups))
|
versegroup)
|
||||||
(columnize-list (+ index 1) (cdr items)))))
|
|
||||||
(interpret-markup layout props
|
(interpret-markup layout props
|
||||||
(make-fill-line-markup (list (make-verseformat-markup (make-line-markup
|
(make-fill-line-markup (cons (make-verseformat-markup (make-line-markup
|
||||||
(add-markup-between-elements #f
|
(reverse (hash-fold (lambda (key value l)
|
||||||
(make-hspace-markup verse-hspace)
|
(cons (make-column-markup
|
||||||
(map (lambda (column-markups)
|
(fold (lambda (v verses)
|
||||||
(make-column-markup
|
(cons v (if (null? verses)
|
||||||
(add-markup-between-elements #t (make-vspace-markup verse-vspace) column-markups)))
|
verses
|
||||||
column-data)))))))))
|
(cons (make-vspace-markup verse-vspace) verses))))
|
||||||
|
(list) value))
|
||||||
|
(if (null-list? l)
|
||||||
|
l
|
||||||
|
(cons (make-hspace-markup verse-hspace) l))))
|
||||||
|
(list) h))))
|
||||||
|
(list))))))
|
Reference in New Issue
Block a user