Rendering code refactor
This commit is contained in:
@@ -1,19 +1,3 @@
|
||||
% -----------------------------------------------------
|
||||
% Comandes últils
|
||||
% -----------------------------------------------------
|
||||
% Anacrusa: \partial 2 (2 = blanca)
|
||||
%
|
||||
% Repetició amb caselles:
|
||||
% \repeat volta 2 {
|
||||
% %%%
|
||||
% \alternative {
|
||||
% \volta 1 { %%% }
|
||||
% \volta 2 { %%% }
|
||||
% }
|
||||
% }
|
||||
%
|
||||
% -----------------------------------------------------
|
||||
|
||||
\new ChordNames {
|
||||
\chords {
|
||||
\set chordChanges = ##t
|
||||
@@ -50,11 +34,21 @@
|
||||
|
||||
% A
|
||||
\mark \default
|
||||
|
||||
\bar "||" \break
|
||||
\repeat volta 2 {
|
||||
\alternative {
|
||||
\volta 1 { }
|
||||
\volta 2 { }
|
||||
}
|
||||
}
|
||||
|
||||
% B
|
||||
\mark \default
|
||||
\repeat volta 2 {
|
||||
\alternative {
|
||||
\volta 1 { }
|
||||
\volta 2 { }
|
||||
}
|
||||
}
|
||||
|
||||
\bar "|."
|
||||
}
|
||||
|
||||
@@ -6,11 +6,9 @@
|
||||
}
|
||||
|
||||
\header {
|
||||
title = \markup { "{{ tema.title | safe }}" }
|
||||
{% if tema.composer() %}
|
||||
composer = "{{ tema.composer() | safe }}"
|
||||
{% elif tema.origin() %}
|
||||
composer = "{{ tema.origin() | safe }}"
|
||||
title = \markup { "{{ tune.header.title | safe }}" }
|
||||
{% if tune.header.composer %}
|
||||
composer = "{{ tune.header.composer | safe }}"
|
||||
{% endif %}
|
||||
|
||||
tagline = "Partitura generada amb LilyPond"
|
||||
@@ -19,15 +17,17 @@
|
||||
|
||||
\markup \vspace #2
|
||||
|
||||
{% if tune.score_source is not none %}
|
||||
\score {
|
||||
\language "english"
|
||||
<<
|
||||
{{ score_beginning }}
|
||||
{{ score_source | safe }}
|
||||
{{ tune.score_source | safe }}
|
||||
>>
|
||||
}
|
||||
{% if lyrics_text is not none %}
|
||||
{% for line in lyrics_text.lines %}
|
||||
{% endif %}
|
||||
{% if tune.lyrics is not none %}
|
||||
{% for line in tune.lyrics.lines %}
|
||||
\markup {
|
||||
\vspace #2
|
||||
\fill-line {
|
||||
@@ -42,7 +42,7 @@
|
||||
\hspace #1
|
||||
}
|
||||
}
|
||||
{% if loop.index < lyrics_text.lines|length %}
|
||||
{% if loop.index < tune.lyrics.lines|length %}
|
||||
\markup {
|
||||
\vspace #1
|
||||
\fill-line {
|
||||
46
folkugat_web/assets/templates/lilypond/tune_in_set.ly
Normal file
46
folkugat_web/assets/templates/lilypond/tune_in_set.ly
Normal file
@@ -0,0 +1,46 @@
|
||||
\markup {
|
||||
\vspace #2
|
||||
\fill-line {
|
||||
\center-column {
|
||||
\large \bold "{{ tune.header.title | safe }}"
|
||||
{% if tune.header.composer %}
|
||||
"{{ tune.header.composer | safe }}"
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
}
|
||||
{% if tune.score_source is not none %}
|
||||
\score {
|
||||
\language "english"
|
||||
<<
|
||||
{{ tune.score_source | safe }}
|
||||
>>
|
||||
}
|
||||
{% endif %}
|
||||
{% if tune.lyrics is not none %}
|
||||
{% for line in tune.lyrics.lines %}
|
||||
\markup {
|
||||
\vspace #2
|
||||
\fill-line {
|
||||
{% for paragraph in line.paragraphs %}
|
||||
\hspace #1
|
||||
\center-column {
|
||||
{% for line in paragraph.lines %}
|
||||
\line { {{ line | safe }} }
|
||||
{% endfor %}
|
||||
}
|
||||
{% endfor %}
|
||||
\hspace #1
|
||||
}
|
||||
}
|
||||
{% if loop.index < tune.lyrics.lines|length %}
|
||||
\markup {
|
||||
\vspace #1
|
||||
\fill-line {
|
||||
\override #'(span-factor . 4/9)
|
||||
\draw-hline
|
||||
}
|
||||
}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
31
folkugat_web/assets/templates/lilypond/tune_set.ly
Normal file
31
folkugat_web/assets/templates/lilypond/tune_set.ly
Normal file
@@ -0,0 +1,31 @@
|
||||
{{ score_beginning }}
|
||||
\version "2.24.4"
|
||||
\book {
|
||||
\paper {
|
||||
top-margin = 10
|
||||
left-margin = 15
|
||||
right-margin = 15
|
||||
|
||||
scoreTitleMarkup = \markup {
|
||||
\center-column {
|
||||
\fontsize #3 \bold \fromproperty #'header:piece
|
||||
\fill-line {
|
||||
\null
|
||||
\right-column {
|
||||
\fromproperty #'header:composer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\header {
|
||||
title = \markup { "{{ tune_set.title | safe }}" }
|
||||
tagline = "Partitura generada amb LilyPond"
|
||||
copyright = "Folkugat"
|
||||
}
|
||||
|
||||
{% for tune in tune_set.tunes %}
|
||||
{% include "lilypond/tune_in_set.ly" %}
|
||||
{% endfor %}
|
||||
}
|
||||
Reference in New Issue
Block a user