lydown 0.12.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +41 -1
- data/bin/lydown +2 -0
- data/lib/lydown.rb +6 -2
- data/lib/lydown/cache.rb +5 -1
- data/lib/lydown/cli.rb +1 -1
- data/lib/lydown/cli/commands.rb +7 -11
- data/lib/lydown/cli/compiler.rb +5 -0
- data/lib/lydown/cli/proofing.rb +2 -2
- data/lib/lydown/cli/repl.rb +1 -1
- data/lib/lydown/cli/support.rb +0 -33
- data/lib/lydown/defaults.yml +50 -8
- data/lib/lydown/inverso.rb +84 -0
- data/lib/lydown/lilypond.rb +76 -10
- data/lib/lydown/ly_lib/lib.ly +140 -127
- data/lib/lydown/parsing/lydown.treetop +25 -12
- data/lib/lydown/parsing/nodes.rb +55 -19
- data/lib/lydown/rendering.rb +72 -1
- data/lib/lydown/rendering/base.rb +21 -0
- data/lib/lydown/rendering/command.rb +53 -0
- data/lib/lydown/rendering/layout.rb +83 -0
- data/lib/lydown/rendering/lyrics.rb +1 -1
- data/lib/lydown/rendering/markup.rb +23 -0
- data/lib/lydown/rendering/movement.rb +7 -4
- data/lib/lydown/rendering/music.rb +35 -29
- data/lib/lydown/rendering/notes.rb +75 -41
- data/lib/lydown/rendering/repeats.rb +27 -0
- data/lib/lydown/rendering/settings.rb +36 -9
- data/lib/lydown/rendering/skipping.rb +10 -2
- data/lib/lydown/rendering/staff.rb +38 -31
- data/lib/lydown/rendering/voices.rb +1 -1
- data/lib/lydown/templates.rb +8 -8
- data/lib/lydown/templates/layout.rb +40 -0
- data/lib/lydown/templates/lilypond_doc.rb +95 -0
- data/lib/lydown/templates/movement.rb +188 -0
- data/lib/lydown/templates/multi_voice.rb +25 -0
- data/lib/lydown/templates/part.rb +146 -0
- data/lib/lydown/templates/variables.rb +43 -0
- data/lib/lydown/translation/ripple.rb +1 -1
- data/lib/lydown/translation/ripple/nodes.rb +51 -2
- data/lib/lydown/translation/ripple/ripple.treetop +87 -10
- data/lib/lydown/version.rb +1 -1
- data/lib/lydown/work.rb +19 -2
- data/lib/lydown/work_context.rb +10 -2
- metadata +12 -8
- data/lib/lydown/cli/installer.rb +0 -175
- data/lib/lydown/templates/lilypond_doc.erb +0 -34
- data/lib/lydown/templates/movement.erb +0 -118
- data/lib/lydown/templates/multi_voice.erb +0 -16
- data/lib/lydown/templates/part.erb +0 -118
- data/lib/lydown/templates/variables.erb +0 -43
@@ -0,0 +1,27 @@
|
|
1
|
+
module Lydown::Rendering
|
2
|
+
class RepeatStart < Base
|
3
|
+
def translate
|
4
|
+
@context.emit(:music, "\\repeat volta #{@event[:count]} { ")
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class RepeatVolta < Base
|
9
|
+
def translate
|
10
|
+
@context['process/volta_count'] ||= 0
|
11
|
+
|
12
|
+
if @context['process/volta_count'] == 0
|
13
|
+
@context.emit(:music, "} \\alternative { { ")
|
14
|
+
else
|
15
|
+
@context.emit(:music, "} { ")
|
16
|
+
end
|
17
|
+
@context['process/volta_count'] += 1
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class RepeatEnd < Base
|
22
|
+
def translate
|
23
|
+
@context['process/volta_count'] = nil
|
24
|
+
@context.emit(:music, "} } ")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -7,13 +7,13 @@ module Lydown::Rendering
|
|
7
7
|
class Setting < Base
|
8
8
|
include Notes
|
9
9
|
|
10
|
-
SETTING_KEYS =
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
SETTING_KEYS = %w{
|
11
|
+
key time pickup clef part movement tempo accidentals beams end_barline
|
12
|
+
macros empty_staves midi_tempo instrument_names instrument_name_style
|
13
|
+
parts score movement_source colla_parte include require mode nomode
|
14
|
+
bar_numbers document notation_size work transpose editions layout
|
15
|
+
movement_title
|
16
|
+
}
|
17
17
|
|
18
18
|
RENDERABLE_SETTING_KEYS = [
|
19
19
|
'key', 'time', 'clef', 'beams'
|
@@ -25,7 +25,7 @@ module Lydown::Rendering
|
|
25
25
|
'empty_staves' => ['hide', 'show'],
|
26
26
|
'instrument_names' => ['hide', 'show', 'inline', 'inline-right-align', 'inline-center-align'],
|
27
27
|
'instrument_name_style' => ['normal', 'smallcaps'],
|
28
|
-
'page_break' => ['none', 'before', 'after', 'before and after', 'blank page before'],
|
28
|
+
'page_break' => ['none', 'before', 'after', 'before and after', 'blank page before', 'bookpart before'],
|
29
29
|
'mode' => ['score', 'part', 'none'],
|
30
30
|
'bar_numbers' => ['hide', 'shows'],
|
31
31
|
'notation_size' => ['huge', 'large', 'normalsize', 'small', 'tiny', 'teeny']
|
@@ -38,7 +38,7 @@ module Lydown::Rendering
|
|
38
38
|
end
|
39
39
|
|
40
40
|
key = @event[:key]
|
41
|
-
value = @event[:value]
|
41
|
+
value = @event[:value] && @event[:value].gsub("\\n", "\n")
|
42
42
|
level = @event[:level] || 0
|
43
43
|
|
44
44
|
unless (level > 0) || SETTING_KEYS.include?(key)
|
@@ -67,6 +67,8 @@ module Lydown::Rendering
|
|
67
67
|
@context.reset(:movement)
|
68
68
|
when 'include'
|
69
69
|
add_include(:includes, value)
|
70
|
+
when 'require'
|
71
|
+
add_require(:requires, value)
|
70
72
|
when 'mode'
|
71
73
|
set_mode(value.nil? ? :none : value.to_sym)
|
72
74
|
when 'nomode'
|
@@ -87,6 +89,12 @@ module Lydown::Rendering
|
|
87
89
|
case key
|
88
90
|
when 'include'
|
89
91
|
add_include(path + 'includes', value)
|
92
|
+
when 'require'
|
93
|
+
add_require(path + 'requires', value)
|
94
|
+
when 'lyrics_markup_file'
|
95
|
+
set_lyrics_markup(path, value)
|
96
|
+
when 'order' # staff order
|
97
|
+
set_staff_order(path, value)
|
90
98
|
else
|
91
99
|
path << key
|
92
100
|
@context.set_setting(path, value)
|
@@ -163,6 +171,11 @@ module Lydown::Rendering
|
|
163
171
|
@context['process/mode'] = (mode == :none) ? nil : mode
|
164
172
|
end
|
165
173
|
|
174
|
+
def set_staff_order(path, order)
|
175
|
+
order = order.split(',').map {|s| s.strip}
|
176
|
+
@context.set_setting("#{path}order", order)
|
177
|
+
end
|
178
|
+
|
166
179
|
def add_include(includes_path, path)
|
167
180
|
includes = @context.get_current_setting(includes_path) || []
|
168
181
|
|
@@ -180,6 +193,20 @@ module Lydown::Rendering
|
|
180
193
|
|
181
194
|
@context.set_setting(includes_path, includes)
|
182
195
|
end
|
196
|
+
|
197
|
+
def set_lyrics_markup(path, fn)
|
198
|
+
source_filename = @context['process/last_filename']
|
199
|
+
if source_filename
|
200
|
+
fn = File.expand_path(File.join(File.dirname(source_filename), fn))
|
201
|
+
end
|
202
|
+
@context.set_setting("#{path}lyrics_markup", IO.read(fn))
|
203
|
+
end
|
204
|
+
|
205
|
+
def add_require(requires_path, package)
|
206
|
+
requires = @context.get_current_setting(requires_path) || []
|
207
|
+
requires << package
|
208
|
+
@context.set_setting(requires_path, requires)
|
209
|
+
end
|
183
210
|
end
|
184
211
|
end
|
185
212
|
|
@@ -2,12 +2,20 @@ module Lydown::Rendering
|
|
2
2
|
PROOFING_LY_SETTINGS = <<EOF
|
3
3
|
\\paper {
|
4
4
|
indent=0\\mm
|
5
|
-
line-width=110\\mm
|
6
5
|
oddFooterMarkup=##f
|
7
6
|
oddHeaderMarkup=##f
|
8
7
|
bookTitleMarkup = ##f
|
9
8
|
scoreTitleMarkup = ##f
|
10
|
-
page-breaking = #ly:minimal-breaking
|
9
|
+
page-breaking = #ly:minimal-breaking %#ly:one-line-auto-height-breaking
|
10
|
+
top-margin=10\\mm
|
11
|
+
bottom-margin=10\\mm
|
12
|
+
}
|
13
|
+
|
14
|
+
\\layout {
|
15
|
+
\\context {
|
16
|
+
\\Score
|
17
|
+
\\remove "Bar_number_engraver"
|
18
|
+
}
|
11
19
|
}
|
12
20
|
EOF
|
13
21
|
|
@@ -1,7 +1,12 @@
|
|
1
1
|
module Lydown::Rendering
|
2
2
|
module Staff
|
3
3
|
def self.staff_groups(context, opts, parts)
|
4
|
+
if context.render_mode == :part
|
5
|
+
opts = opts.merge(part: context['render_opts/parts'])
|
6
|
+
end
|
7
|
+
|
4
8
|
model = context.get_setting('score/order', opts)
|
9
|
+
|
5
10
|
parts_copy = parts.clone
|
6
11
|
|
7
12
|
groups = []
|
@@ -23,43 +28,38 @@ module Lydown::Rendering
|
|
23
28
|
groups
|
24
29
|
end
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
# returns a hierarchy of staffgroups, each containing group configuration
|
32
|
+
# and a list of parts
|
33
|
+
def self.staff_group_hierarchy(context, staff_groups)
|
34
|
+
staff_groups.map {|group|
|
35
|
+
{
|
36
|
+
class: 'StaffGroup',
|
37
|
+
config: staff_group_config(context, group),
|
38
|
+
parts: group
|
39
|
+
}
|
40
|
+
}
|
41
|
+
end
|
30
42
|
|
31
|
-
|
32
|
-
|
43
|
+
VOCAL_GROUP_SPAN_BAR_OVERRIDE =
|
44
|
+
"\\override SpanBar #'break-visibility = #'#( #t #f #t )"
|
33
45
|
|
34
|
-
def self.
|
35
|
-
if group
|
36
|
-
|
37
|
-
elsif BRACKET_PARTS.include?(group.first)
|
38
|
-
"SystemStartBracket"
|
46
|
+
def self.staff_group_config(context, group)
|
47
|
+
if is_vocal_group?(group)
|
48
|
+
VOCAL_GROUP_SPAN_BAR_OVERRIDE
|
39
49
|
else
|
40
|
-
|
50
|
+
''
|
41
51
|
end
|
42
52
|
end
|
43
53
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
54
|
-
m
|
55
|
-
end
|
56
|
-
|
57
|
-
if (staff_groups.size == 1) && (staff_groups[0].size > 1) && directive == "SystemStartBracket"
|
58
|
-
# If all staves are already group, no need to add the system bracket
|
59
|
-
"#'#{expr}"
|
60
|
-
else
|
61
|
-
"#'(SystemStartBar #{expr})"
|
62
|
-
end
|
54
|
+
VOCAL_PARTS = %w{
|
55
|
+
soprano alto tenore basso soprano1 soprano2 alto1 alto2 tenore1 tenore2
|
56
|
+
basso1 basso2 1soprano 2soprano 1alto 2alto 1tenore 2tenore 1basso 2basso
|
57
|
+
1soprano1 1soprano2 2soprano1 2soprano2 1alto1 1alto2 2alto1 2alto2
|
58
|
+
1tenore1 1tenore2 2tenore1 2tenore2 1basso1 1basso2 2basso1 2basso2
|
59
|
+
}
|
60
|
+
|
61
|
+
def self.is_vocal_group?(group)
|
62
|
+
!!group.find {|part| VOCAL_PARTS.include? part }
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.clef(context, opts)
|
@@ -105,6 +105,13 @@ module Lydown::Rendering
|
|
105
105
|
title.strip
|
106
106
|
end
|
107
107
|
|
108
|
+
def self.heading_part_title(context, opts)
|
109
|
+
title = context.get_setting("parts/#{opts[:part]}/heading_title", opts) ||
|
110
|
+
context.get_setting("parts/#{opts[:part]}/title", opts) ||
|
111
|
+
Lydown::Rendering.default_part_title(opts[:part])
|
112
|
+
title.strip
|
113
|
+
end
|
114
|
+
|
108
115
|
def self.part_title(context, opts)
|
109
116
|
title = qualified_part_title(context, opts)
|
110
117
|
|
@@ -11,7 +11,7 @@ module Lydown::Rendering
|
|
11
11
|
def self.render_voices(context)
|
12
12
|
context['process/voice_selector'] = nil
|
13
13
|
|
14
|
-
music =
|
14
|
+
music = Inverso::Template.render(:multi_voice, context: context, part: context[:part])
|
15
15
|
|
16
16
|
context.emit(:music, music)
|
17
17
|
|
data/lib/lydown/templates.rb
CHANGED
@@ -3,29 +3,29 @@ require 'erb'
|
|
3
3
|
module Lydown
|
4
4
|
module Templates
|
5
5
|
TEMPLATES_DIR = File.join(File.dirname(__FILE__), 'templates')
|
6
|
-
|
6
|
+
|
7
7
|
@@templates = {}
|
8
|
-
|
8
|
+
|
9
9
|
def self.render(name, ctx, locals = {})
|
10
10
|
_binding = ctx.respond_to?(:template_binding) ? ctx.template_binding(locals) : binding
|
11
11
|
|
12
12
|
# remove trailing white space and superfluous new lines
|
13
13
|
template(name).result(_binding).gsub(/^\s+$/, '').gsub(/\n+/m, "\n")
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def self.template(name)
|
17
17
|
@@templates[name] ||= load_template(name)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def self.load_template(name)
|
21
|
-
fn = name.is_a?(Symbol) ?
|
21
|
+
fn = name.is_a?(Symbol) ?
|
22
22
|
File.join(TEMPLATES_DIR, "#{name}.erb") :
|
23
23
|
name
|
24
|
-
|
24
|
+
|
25
25
|
ERB.new IO.read(fn), 0, '<>'
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
module TemplateBinding
|
30
30
|
# Used to bind to instance when rendering templates
|
31
31
|
def template_binding(locals = {})
|
@@ -34,4 +34,4 @@ module Lydown
|
|
34
34
|
b
|
35
35
|
end
|
36
36
|
end
|
37
|
-
end
|
37
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
info = Lydown::Rendering.layout_info(context)
|
2
|
+
return unless info
|
3
|
+
|
4
|
+
layout = Lydown::Rendering::Layout
|
5
|
+
|
6
|
+
pp = lambda {|k| layout.to_pp(info[k])}
|
7
|
+
m = lambda {|k, d = nil| layout.fmt(info[k] || d)}
|
8
|
+
v = lambda {|k| layout.to_v(info[k])}
|
9
|
+
|
10
|
+
vertical_margins = layout.calculate_vertical_margins(info).join(" ")
|
11
|
+
`
|
12
|
+
\paper {
|
13
|
+
{{?false}}
|
14
|
+
annotate-spacing = ##t
|
15
|
+
{{/}}
|
16
|
+
|
17
|
+
{{layout.define_paper_size(info)}}
|
18
|
+
#(layout-set-staff-size {{pp[:staff_size]}})
|
19
|
+
|
20
|
+
%indent = {{m[:indent, '0mm']}}
|
21
|
+
|
22
|
+
{{?info[:margin_inner]}}
|
23
|
+
two-sided = ##t
|
24
|
+
inner-margin = {{m[:margin_inner]}}
|
25
|
+
outer-margin = {{m[:margin_outer]}}
|
26
|
+
binding-offset = 0\mm
|
27
|
+
{{/}}
|
28
|
+
|
29
|
+
top-margin = {{m[:margin_top]}}
|
30
|
+
bottom-margin = {{m[:margin_bottom]}}
|
31
|
+
}
|
32
|
+
\setVerticalMargins {{vertical_margins}}
|
33
|
+
|
34
|
+
\layout {
|
35
|
+
\context {
|
36
|
+
\Score
|
37
|
+
\remove "Bar_number_engraver"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
`
|
@@ -0,0 +1,95 @@
|
|
1
|
+
`
|
2
|
+
\version "2.18.2"
|
3
|
+
|
4
|
+
{{? context.render_mode}}
|
5
|
+
#(define lydown:render-mode '{{context.render_mode}})
|
6
|
+
{{/}}
|
7
|
+
|
8
|
+
{{? !context['render_opts/no_lib']}}
|
9
|
+
\pinclude "{{File.join(LY_LIB_DIR, 'lib.ly')}}"
|
10
|
+
{{/}}
|
11
|
+
`
|
12
|
+
|
13
|
+
Lydown::Rendering.get_set_variables(context).each do |k, v|
|
14
|
+
`
|
15
|
+
#(define lydown:{{k}} {{v}})
|
16
|
+
`
|
17
|
+
end
|
18
|
+
|
19
|
+
proof_mode = context.render_mode == :proof
|
20
|
+
|
21
|
+
includes = Lydown::Rendering.include_files(context, {})
|
22
|
+
includes.each {|i| __emit__[i, " "]}
|
23
|
+
|
24
|
+
if proof_mode
|
25
|
+
__emit__[Lydown::Rendering::PROOFING_LY_SETTINGS]
|
26
|
+
end
|
27
|
+
|
28
|
+
unless context['render_opts/no_layout']
|
29
|
+
__render__(:layout, _)
|
30
|
+
end
|
31
|
+
|
32
|
+
packages = Lydown::Rendering.packages_to_load(context, {})
|
33
|
+
packages.each do |p|
|
34
|
+
`
|
35
|
+
\require "{{p}}"
|
36
|
+
`
|
37
|
+
end
|
38
|
+
|
39
|
+
__render__(:variables, _)
|
40
|
+
|
41
|
+
work = context.get_setting('work', {}) || {}
|
42
|
+
markup = lambda {|m| Lydown::Rendering::Markup.convert(m) }
|
43
|
+
part_title = (context.render_mode == :part) &&
|
44
|
+
(part = context['render_opts/parts']) &&
|
45
|
+
Lydown::Rendering::Staff.heading_part_title(context, part: part)
|
46
|
+
doc_page_break = (context.render_mode == :part) ?
|
47
|
+
context.get_setting("parts/#{context['render_opts/parts']}/document/page_break", {}) :
|
48
|
+
context.get_setting("#{context.render_mode}/document/page_break", {})
|
49
|
+
|
50
|
+
`
|
51
|
+
{{? !proof_mode}}
|
52
|
+
\book {
|
53
|
+
{{/}}
|
54
|
+
{{?doc_page_break == 'blank page before'}}
|
55
|
+
\paper {
|
56
|
+
first-page-number = #-1
|
57
|
+
}
|
58
|
+
{{/}}
|
59
|
+
\header {
|
60
|
+
{{?t = work[:composer]}}composer = {{markup[t]}}{{/}}
|
61
|
+
{{?t = work[:opus]}}opus = {{markup[t]}}{{/}}
|
62
|
+
{{?t = work[:title]}}title = {{markup[t]}}{{/}}
|
63
|
+
{{?t = work[:subtitle]}}subtitle = {{markup[t]}}{{/}}
|
64
|
+
{{?t = work[:source]}}source = {{markup[t]}}{{/}}
|
65
|
+
{{?t = work[:edition]}}edition = {{markup[t]}}{{/}}
|
66
|
+
{{?part_title}}instrument = {{markup[part_title]}}{{/}}
|
67
|
+
}
|
68
|
+
|
69
|
+
{{? !proof_mode}}
|
70
|
+
\bookpart {
|
71
|
+
{{/}}
|
72
|
+
|
73
|
+
{{?doc_page_break == 'before'}}
|
74
|
+
\pageBreak
|
75
|
+
{{/}}
|
76
|
+
|
77
|
+
{{?doc_page_break == 'blank page before'}}
|
78
|
+
\paper { oddHeaderMarkup = ##f evenHeaderMarkup = ##f }
|
79
|
+
\markup " "
|
80
|
+
} \bookpart {
|
81
|
+
\paper { oddHeaderMarkup = ##f evenHeaderMarkup = ##f
|
82
|
+
bookTitleMarkup = ##f } \markup { " " }
|
83
|
+
} \bookpart {
|
84
|
+
\paper { bookTitleMarkup = ##f }
|
85
|
+
{{/}}
|
86
|
+
`
|
87
|
+
|
88
|
+
context['movements'].each do |n, m|
|
89
|
+
__render__(:movement, context: context, name: n, movement: m)
|
90
|
+
end
|
91
|
+
`
|
92
|
+
{{? !proof_mode}}
|
93
|
+
} }
|
94
|
+
{{/}}
|
95
|
+
`
|
@@ -0,0 +1,188 @@
|
|
1
|
+
render_mode = context.render_mode
|
2
|
+
staff_groups = Lydown::Rendering::Staff.staff_groups(
|
3
|
+
context, {movement: name}, movement['parts'].keys)
|
4
|
+
parts_in_order = staff_groups.flatten
|
5
|
+
|
6
|
+
staff_group_hierarchy = Lydown::Rendering::Staff.staff_group_hierarchy(context, staff_groups)
|
7
|
+
|
8
|
+
|
9
|
+
parts = parts_in_order.inject({}) do |m, p|
|
10
|
+
m[p] = movement['parts'][p]
|
11
|
+
m
|
12
|
+
end
|
13
|
+
|
14
|
+
score_mode = (render_mode == :score) ||
|
15
|
+
(render_mode == :proof) || (parts.size > 1)
|
16
|
+
|
17
|
+
tacet = Lydown::Rendering::Movement.tacet?(context, name)
|
18
|
+
movement_title = Lydown::Rendering::Movement.movement_title(context, name)
|
19
|
+
movement_source = context.get_setting(:movement_source , movement: name)
|
20
|
+
lyrics_markup = Lydown::Rendering.lyrics_markup(context, movement: name)
|
21
|
+
|
22
|
+
format = context['options/format'] || context['render_opts/format'] || :pdf
|
23
|
+
midi_mode = (format == :midi) || (format == :mp3)
|
24
|
+
|
25
|
+
empty_staves = context.get_setting(:empty_staves, movement: name)
|
26
|
+
|
27
|
+
page_breaks = Lydown::Rendering::Movement.page_breaks(context, movement: name)
|
28
|
+
|
29
|
+
includes = Lydown::Rendering.include_files(context, movement: name)
|
30
|
+
|
31
|
+
packages = Lydown::Rendering.packages_to_load(context, movement: name)
|
32
|
+
|
33
|
+
hide_bar_numbers = Lydown::Rendering::Movement.hide_bar_numbers?(
|
34
|
+
context, movement: name
|
35
|
+
)
|
36
|
+
|
37
|
+
if page_breaks[:blank_page_before]
|
38
|
+
`
|
39
|
+
} \bookpart {
|
40
|
+
\paper { bookTitleMarkup = ##f }
|
41
|
+
\markup \column {
|
42
|
+
\null \null \null \null \null \null
|
43
|
+
\null \null \null \null \null \null
|
44
|
+
\null \null \null \null \null \null
|
45
|
+
\null \null \null \null \null \null
|
46
|
+
\fill-line { "(this page has been left blank to facilitate page turning)" }
|
47
|
+
}
|
48
|
+
} \bookpart {
|
49
|
+
\paper { bookTitleMarkup = ##f }
|
50
|
+
\pageBreak
|
51
|
+
`
|
52
|
+
elsif page_breaks[:before]
|
53
|
+
`
|
54
|
+
\pageBreak
|
55
|
+
`
|
56
|
+
elsif page_breaks[:bookpart_before]
|
57
|
+
`
|
58
|
+
} \bookpart {
|
59
|
+
\paper { bookTitleMarkup = ##f }
|
60
|
+
`
|
61
|
+
end
|
62
|
+
|
63
|
+
packages.each do |p|
|
64
|
+
`
|
65
|
+
\require "{{p}}"
|
66
|
+
`
|
67
|
+
end
|
68
|
+
|
69
|
+
includes.each {|i| __emit__[i, " "]}
|
70
|
+
|
71
|
+
unless tacet
|
72
|
+
`
|
73
|
+
\score {
|
74
|
+
`
|
75
|
+
if movement_title && render_mode != :proof
|
76
|
+
`
|
77
|
+
\header {
|
78
|
+
piece = {{movement_title.inspect}}
|
79
|
+
{{?movement_source}}
|
80
|
+
movement-source = {{movement_source.inspect}}
|
81
|
+
{{/}}
|
82
|
+
{{?lyrics_markup}}
|
83
|
+
lyrics-markup = {{lyrics_markup}}
|
84
|
+
{{/}}
|
85
|
+
}
|
86
|
+
`
|
87
|
+
end
|
88
|
+
|
89
|
+
layout = Lydown::Rendering.layout_info(context, movement: name)
|
90
|
+
ragged_right = layout[:ragged_right] == "true"
|
91
|
+
ragged_last = layout[:ragged_last] == "true"
|
92
|
+
`
|
93
|
+
{{?n = movement['bar_number']}}
|
94
|
+
\set Score.currentBarNumber = {{n}}
|
95
|
+
\set Score.barNumberVisibility = #all-bar-numbers-visible
|
96
|
+
\bar ""
|
97
|
+
{{/}}
|
98
|
+
|
99
|
+
\new OrchestraGroup \with {
|
100
|
+
} <<
|
101
|
+
`
|
102
|
+
|
103
|
+
first_staff = true
|
104
|
+
staff_group_hierarchy.each do |group|
|
105
|
+
`
|
106
|
+
\new {{group[:class]}} \with {
|
107
|
+
{{?first_staff}}
|
108
|
+
\consists "Bar_number_engraver"
|
109
|
+
{{/}}
|
110
|
+
{{group[:config]}}
|
111
|
+
} <<
|
112
|
+
`
|
113
|
+
|
114
|
+
group[:parts].each do |part_name|
|
115
|
+
part = movement['parts'][part_name]
|
116
|
+
__render__(:part, context: context, name: part_name, part: part,
|
117
|
+
movement_name: name, movement: movement)
|
118
|
+
end
|
119
|
+
first_staff = false
|
120
|
+
|
121
|
+
`
|
122
|
+
>>
|
123
|
+
`
|
124
|
+
end
|
125
|
+
|
126
|
+
`
|
127
|
+
>>
|
128
|
+
`
|
129
|
+
|
130
|
+
if midi_mode
|
131
|
+
`
|
132
|
+
\midi {
|
133
|
+
{{? tempo = context.get_setting(:midi_tempo, movement: name)}}
|
134
|
+
\tempo {{tempo}}
|
135
|
+
{{/}}
|
136
|
+
}
|
137
|
+
`
|
138
|
+
end
|
139
|
+
|
140
|
+
`
|
141
|
+
|
142
|
+
\layout {
|
143
|
+
{{?ragged_right}}ragged-right = ##t{{/}}
|
144
|
+
{{?ragged_last}}ragged-last = ##t{{/}}
|
145
|
+
|
146
|
+
{{?score_mode && (empty_staves == 'hide')}}
|
147
|
+
\context {
|
148
|
+
\RemoveEmptyStaffContext
|
149
|
+
\override VerticalAxisGroup #'remove-first = ##t
|
150
|
+
}
|
151
|
+
{{/}}
|
152
|
+
|
153
|
+
{{?layout[:system_count]}}
|
154
|
+
system-count = {{layout[:system_count]}}
|
155
|
+
{{/}}
|
156
|
+
|
157
|
+
{{?hide_bar_numbers}}
|
158
|
+
\context {
|
159
|
+
\Score
|
160
|
+
\omit BarNumber
|
161
|
+
}
|
162
|
+
{{/}}
|
163
|
+
|
164
|
+
{{?layout[:indent]}}
|
165
|
+
indent = {{Lydown::Rendering::Layout.fmt(layout[:indent])}}
|
166
|
+
{{/}}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
`
|
170
|
+
else # tacet
|
171
|
+
`
|
172
|
+
\score {
|
173
|
+
\header {
|
174
|
+
piece = {{movement_title.inspect}}
|
175
|
+
{{?lyrics_markup}}
|
176
|
+
lyrics-markup = {{lyrics_markup}}
|
177
|
+
{{/}}
|
178
|
+
}
|
179
|
+
\tacetScore
|
180
|
+
}
|
181
|
+
`
|
182
|
+
end
|
183
|
+
|
184
|
+
if page_breaks[:after]
|
185
|
+
`
|
186
|
+
\pageBreak
|
187
|
+
`
|
188
|
+
end
|