Compare commits
1 Commits
603b25831a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e528a5328 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,8 +1,8 @@
|
|||||||
# ---> Lilypond
|
# ---> Lilypond
|
||||||
*.pdf
|
*.pdf
|
||||||
*.cho
|
|
||||||
*.ps
|
*.ps
|
||||||
*.midi
|
*.midi
|
||||||
*.mid
|
*.mid
|
||||||
*.log
|
*.log
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
\include "eps_file_from_song_dir.ily"
|
\include "eps_file_from_song_dir.ily"
|
||||||
\include "title_with_category_images.ily"
|
\include "title_with_category_images.ily"
|
||||||
\include "chord_settings.ily"
|
\include "chord_settings.ily"
|
||||||
\include "chordpro.ily"
|
|
||||||
\include "transposition.ily"
|
\include "transposition.ily"
|
||||||
|
\include "markup_tag_groups_hack.ily"
|
||||||
\include "verses_with_chords.ily"
|
\include "verses_with_chords.ily"
|
||||||
\include "arrows_in_scores.ily"
|
\include "arrows_in_scores.ily"
|
||||||
\include "swing_style.ily"
|
\include "swing_style.ily"
|
||||||
|
|||||||
@@ -158,8 +158,6 @@ override-stanza =
|
|||||||
#(define (stanza . stanzanumbers)
|
#(define (stanza . stanzanumbers)
|
||||||
#{
|
#{
|
||||||
\once \override StanzaNumber.details.custom-realstanza = ##t % 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
|
||||||
\once \override StanzaNumber.details.custom-stanza-type = #'verse
|
|
||||||
\once \override StanzaNumber.details.custom-stanza-numbers = #stanzanumbers
|
|
||||||
\applyContext
|
\applyContext
|
||||||
#(lambda (context)
|
#(lambda (context)
|
||||||
(handle-stanza-numbers context stanzanumbers
|
(handle-stanza-numbers context stanzanumbers
|
||||||
@@ -171,8 +169,6 @@ 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.details.custom-realstanza = ##t % 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
|
||||||
\once \override StanzaNumber.details.custom-stanza-type = #'ref
|
|
||||||
\once \override StanzaNumber.details.custom-stanza-numbers = #stanzanumbers
|
|
||||||
\applyContext
|
\applyContext
|
||||||
#(lambda (context)
|
#(lambda (context)
|
||||||
(handle-stanza-numbers context stanzanumbers
|
(handle-stanza-numbers context stanzanumbers
|
||||||
@@ -190,8 +186,6 @@ bridge =
|
|||||||
#(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.details.custom-realstanza = ##t % 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
|
||||||
\once \override StanzaNumber.details.custom-stanza-type = #'bridge
|
|
||||||
\once \override StanzaNumber.details.custom-stanza-numbers = #stanzanumbers
|
|
||||||
\applyContext
|
\applyContext
|
||||||
#(lambda (context)
|
#(lambda (context)
|
||||||
(handle-stanza-numbers context stanzanumbers
|
(handle-stanza-numbers context stanzanumbers
|
||||||
@@ -207,11 +201,8 @@ bridge =
|
|||||||
|
|
||||||
% 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.details.custom-realstanza = ##t 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.
|
||||||
% Sets custom-inline-text for ChordPro export so it can collect the repeat sign separately
|
|
||||||
repStartWithTag = \lyricmode {
|
repStartWithTag = \lyricmode {
|
||||||
\tag #'repeats {
|
\tag #'repeats {
|
||||||
\once \override StanzaNumber.details.custom-inline-text = \repStart
|
|
||||||
\once \override StanzaNumber.details.custom-inline-direction = #LEFT
|
|
||||||
\applyContext
|
\applyContext
|
||||||
#(lambda (context)
|
#(lambda (context)
|
||||||
(let ((lastStanza (ly:context-property context 'stanza))
|
(let ((lastStanza (ly:context-property context 'stanza))
|
||||||
@@ -229,8 +220,6 @@ repStartWithTag = \lyricmode {
|
|||||||
|
|
||||||
repStopWithTag = \lyricmode {
|
repStopWithTag = \lyricmode {
|
||||||
\tag #'repeats {
|
\tag #'repeats {
|
||||||
\once \override StanzaNumber.details.custom-inline-text = \repStop
|
|
||||||
\once \override StanzaNumber.details.custom-inline-direction = #RIGHT
|
|
||||||
\once \override StanzaNumber.font-series = #'normal
|
\once \override StanzaNumber.font-series = #'normal
|
||||||
\once \override StanzaNumber.direction = 1
|
\once \override StanzaNumber.direction = 1
|
||||||
\set stanza = \markup { \pad-x-right #1 \repStop }
|
\set stanza = \markup { \pad-x-right #1 \repStop }
|
||||||
|
|||||||
@@ -40,19 +40,34 @@ shiftChords = #(define-music-function (parser location xshift chords) (number? l
|
|||||||
|
|
||||||
altChord =
|
altChord =
|
||||||
#(define-music-function (parser location mainchord altchord) (ly:music? ly:music?)
|
#(define-music-function (parser location mainchord altchord) (ly:music? ly:music?)
|
||||||
(let* ((chord-name (lambda (in-pitches bass inversion context)
|
(let* ((remove-point-and-click
|
||||||
(make-line-markup (list
|
(lambda (grob)
|
||||||
(ignatzek-chord-names in-pitches bass inversion context)
|
(ly:grob-set-property! grob 'cause #f)
|
||||||
(make-hspace-markup 0.3)
|
(ly:text-interface::print grob)))
|
||||||
(parenthesis-ignatzek-chord-names (music-pitches (transposable (cons (car (music-pitches mainchord)) (car in-pitches)) (music-clone altchord))) '() '() context)
|
(chord-name (lambda (in-pitches bass inversion context) #{
|
||||||
))
|
\markup {
|
||||||
)))
|
\translate #'(-0.5 . 0)
|
||||||
|
\score {
|
||||||
|
\chords { \transposable #(cons (car (music-pitches mainchord)) (car in-pitches)) { #(music-clone mainchord) \klamm #(music-clone altchord) } }
|
||||||
|
\layout {
|
||||||
|
\LAYOUT
|
||||||
|
\context {
|
||||||
|
\ChordNames
|
||||||
|
\override ChordName.extra-spacing-width = #'(0 . 0.3)
|
||||||
|
\override ChordName.stencil = #remove-point-and-click
|
||||||
|
}
|
||||||
|
\context {
|
||||||
|
\Score
|
||||||
|
\override SpacingSpanner.spacing-increment = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}#})))
|
||||||
#{
|
#{
|
||||||
\once \set chordNameFunction = #chord-name
|
\once \set chordNameFunction = #chord-name
|
||||||
#mainchord
|
#mainchord
|
||||||
#}))
|
#}))
|
||||||
|
|
||||||
|
|
||||||
% Akkorde werden so transponiert, dass sie passen, wenn man mit Kapo im angegebenen Bund spielt
|
% Akkorde werden so transponiert, dass sie passen, wenn man mit Kapo im angegebenen Bund spielt
|
||||||
capoTranspose =
|
capoTranspose =
|
||||||
#(define-music-function (fret chords) (number? ly:music?)
|
#(define-music-function (fret chords) (number? ly:music?)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
13
private_includes/base/markup_tag_groups_hack.ily
Normal file
13
private_includes/base/markup_tag_groups_hack.ily
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
% We have to record the tag groups for markup, so we use the right tag groups during markup interpretiton.
|
||||||
|
recordedTagGroups = #'()
|
||||||
|
|
||||||
|
tagGroup =
|
||||||
|
#(define-void-function (tags) (symbol-list?)
|
||||||
|
(let ((err (define-tag-group tags)))
|
||||||
|
(if err (ly:parser-error err (*location*))
|
||||||
|
(set! recordedTagGroups (cons tags recordedTagGroups)))))
|
||||||
|
|
||||||
|
#(define-markup-command (handle-tag-groups layout props recorded-groups m) (list? markup?)
|
||||||
|
(resetTagGroups)
|
||||||
|
(every (lambda (group) (define-tag-group group)) recorded-groups)
|
||||||
|
(interpret-markup layout props m))
|
||||||
@@ -379,8 +379,6 @@ Chord_lyrics_spacing_engraver =
|
|||||||
\override SpacingSpanner.spacing-increment = 0
|
\override SpacingSpanner.spacing-increment = 0
|
||||||
% \override SpacingSpanner.packed-spacing = ##t
|
% \override SpacingSpanner.packed-spacing = ##t
|
||||||
\consists \Chord_lyrics_spacing_engraver
|
\consists \Chord_lyrics_spacing_engraver
|
||||||
% ChordPro engraver in Score context to collect all data
|
|
||||||
\consists \ChordPro_score_collector
|
|
||||||
\remove Bar_number_engraver
|
\remove Bar_number_engraver
|
||||||
\remove Mark_engraver
|
\remove Mark_engraver
|
||||||
\remove Jump_engraver
|
\remove Jump_engraver
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ TEXT = \markuplist {
|
|||||||
\override #`(verselayout . ,verselayout)
|
\override #`(verselayout . ,verselayout)
|
||||||
\override #`(verse-chords . ,#{ \chords { \verseChords } #})
|
\override #`(verse-chords . ,#{ \chords { \verseChords } #})
|
||||||
\override #`(verse-reference-voice . ,#{ \global \firstVoice #})
|
\override #`(verse-reference-voice . ,#{ \global \firstVoice #})
|
||||||
|
\handle-tag-groups \recordedTagGroups
|
||||||
\TEXT
|
\TEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ TEXT = \markuplist {
|
|||||||
\override #`(verselayout . ,verselayout)
|
\override #`(verselayout . ,verselayout)
|
||||||
\override #`(verse-chords . ,#{ \chords { \verseChords } #})
|
\override #`(verse-chords . ,#{ \chords { \verseChords } #})
|
||||||
\override #`(verse-reference-voice . ,#{ \global \firstVoice #})
|
\override #`(verse-reference-voice . ,#{ \global \firstVoice #})
|
||||||
|
\handle-tag-groups \recordedTagGroups
|
||||||
#text
|
#text
|
||||||
}
|
}
|
||||||
#})
|
#})
|
||||||
@@ -39,20 +41,6 @@ TEXT = \markuplist {
|
|||||||
TEXT_PAGES
|
TEXT_PAGES
|
||||||
(list TEXT))))
|
(list TEXT))))
|
||||||
|
|
||||||
%% Add invisible ChordPro write trigger to last TEXT_PAGES markuplist
|
|
||||||
#(when (and (defined? 'chordpro-export-enabled) chordpro-export-enabled (pair? TEXT_PAGES))
|
|
||||||
(let* ((last-index (- (length TEXT_PAGES) 1))
|
|
||||||
(last-page (list-ref TEXT_PAGES last-index))
|
|
||||||
(modified-last-page #{
|
|
||||||
\markuplist {
|
|
||||||
#last-page
|
|
||||||
\chordpro-delayed-write
|
|
||||||
}
|
|
||||||
#}))
|
|
||||||
(set! TEXT_PAGES
|
|
||||||
(append (list-head TEXT_PAGES last-index)
|
|
||||||
(list modified-last-page)))))
|
|
||||||
|
|
||||||
#(define (add-text-pages text-pages)
|
#(define (add-text-pages text-pages)
|
||||||
(if (pair? text-pages)
|
(if (pair? text-pages)
|
||||||
(begin
|
(begin
|
||||||
@@ -69,34 +57,12 @@ TEXT = \markuplist {
|
|||||||
(if header (set! $defaultheader header))
|
(if header (set! $defaultheader header))
|
||||||
(if paper (set! $defaultpaper paper))
|
(if paper (set! $defaultpaper paper))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; ChordPro export: Store filename and extract metadata from basicSongInfo FIRST
|
|
||||||
(when (and (defined? 'chordpro-export-enabled) chordpro-export-enabled)
|
|
||||||
;; Use ly:parser-output-name which returns the output basename
|
|
||||||
;; This will write relative to current working directory (same as PDF)
|
|
||||||
(let ((output-name (ly:parser-output-name)))
|
|
||||||
(set! chordpro-current-filename output-name))
|
|
||||||
|
|
||||||
;; Try to extract metadata from basicSongInfo \header block
|
|
||||||
(when (defined? 'basicSongInfo)
|
|
||||||
(let* ((header-alist (ly:module->alist basicSongInfo))
|
|
||||||
(title (assoc-ref header-alist 'title))
|
|
||||||
(authors (assoc-ref header-alist 'authors)))
|
|
||||||
(when title
|
|
||||||
(set! chordpro-header-title
|
|
||||||
(if (markup? title)
|
|
||||||
(markup->string title)
|
|
||||||
(if (string? title) title "Untitled"))))
|
|
||||||
(when authors
|
|
||||||
(set! chordpro-header-authors authors)))))
|
|
||||||
|
|
||||||
(add-score #{
|
(add-score #{
|
||||||
\score {
|
\score {
|
||||||
\MUSIC
|
\MUSIC
|
||||||
\layout { \LAYOUT }
|
\layout { \LAYOUT }
|
||||||
}#})
|
}#})
|
||||||
(add-text-pages TEXT_PAGES)
|
(add-text-pages TEXT_PAGES)
|
||||||
|
|
||||||
(add-score #{
|
(add-score #{
|
||||||
\score {
|
\score {
|
||||||
\unfoldRepeats { \MUSIC \INLINESCOREMUSIC }
|
\unfoldRepeats { \MUSIC \INLINESCOREMUSIC }
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ HEADER = \bookpart {
|
|||||||
\basicSongInfo
|
\basicSongInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\include #(if noDefaultOutput "../private_includes/void.ily" "layout_bottom.ily")
|
\include #(if noDefaultOutput "../private_includes/void.ily" "layout_bottom.ily")
|
||||||
Reference in New Issue
Block a user