lydown 0.12.4 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -1
  3. data/bin/lydown +2 -0
  4. data/lib/lydown.rb +6 -2
  5. data/lib/lydown/cache.rb +5 -1
  6. data/lib/lydown/cli.rb +1 -1
  7. data/lib/lydown/cli/commands.rb +7 -11
  8. data/lib/lydown/cli/compiler.rb +5 -0
  9. data/lib/lydown/cli/proofing.rb +2 -2
  10. data/lib/lydown/cli/repl.rb +1 -1
  11. data/lib/lydown/cli/support.rb +0 -33
  12. data/lib/lydown/defaults.yml +50 -8
  13. data/lib/lydown/inverso.rb +84 -0
  14. data/lib/lydown/lilypond.rb +76 -10
  15. data/lib/lydown/ly_lib/lib.ly +140 -127
  16. data/lib/lydown/parsing/lydown.treetop +25 -12
  17. data/lib/lydown/parsing/nodes.rb +55 -19
  18. data/lib/lydown/rendering.rb +72 -1
  19. data/lib/lydown/rendering/base.rb +21 -0
  20. data/lib/lydown/rendering/command.rb +53 -0
  21. data/lib/lydown/rendering/layout.rb +83 -0
  22. data/lib/lydown/rendering/lyrics.rb +1 -1
  23. data/lib/lydown/rendering/markup.rb +23 -0
  24. data/lib/lydown/rendering/movement.rb +7 -4
  25. data/lib/lydown/rendering/music.rb +35 -29
  26. data/lib/lydown/rendering/notes.rb +75 -41
  27. data/lib/lydown/rendering/repeats.rb +27 -0
  28. data/lib/lydown/rendering/settings.rb +36 -9
  29. data/lib/lydown/rendering/skipping.rb +10 -2
  30. data/lib/lydown/rendering/staff.rb +38 -31
  31. data/lib/lydown/rendering/voices.rb +1 -1
  32. data/lib/lydown/templates.rb +8 -8
  33. data/lib/lydown/templates/layout.rb +40 -0
  34. data/lib/lydown/templates/lilypond_doc.rb +95 -0
  35. data/lib/lydown/templates/movement.rb +188 -0
  36. data/lib/lydown/templates/multi_voice.rb +25 -0
  37. data/lib/lydown/templates/part.rb +146 -0
  38. data/lib/lydown/templates/variables.rb +43 -0
  39. data/lib/lydown/translation/ripple.rb +1 -1
  40. data/lib/lydown/translation/ripple/nodes.rb +51 -2
  41. data/lib/lydown/translation/ripple/ripple.treetop +87 -10
  42. data/lib/lydown/version.rb +1 -1
  43. data/lib/lydown/work.rb +19 -2
  44. data/lib/lydown/work_context.rb +10 -2
  45. metadata +12 -8
  46. data/lib/lydown/cli/installer.rb +0 -175
  47. data/lib/lydown/templates/lilypond_doc.erb +0 -34
  48. data/lib/lydown/templates/movement.erb +0 -118
  49. data/lib/lydown/templates/multi_voice.erb +0 -16
  50. data/lib/lydown/templates/part.erb +0 -118
  51. data/lib/lydown/templates/variables.erb +0 -43
@@ -1,16 +0,0 @@
1
- <<
2
- <% beaming_mode = Lydown::Rendering::Staff.beaming_mode(self, self.current_setting_opts) %>
3
- <% voice_prefix = part.nil? || (part == "") ? nil : "#{part}_" %>
4
-
5
- <% self['process/voices'].each do |voice, stream| %>
6
- <% if voice != 'voice1' %>
7
- \new Voice = "<%= voice_prefix %><%= voice %>"
8
- <% end %>
9
- {
10
- <%= beaming_mode %>
11
- <%= Lydown::Rendering::VoiceSelect.voice_command(voice) %>
12
- <%= stream['music'] %>
13
- }
14
- <% end %>
15
- >>
16
- \oneVoice
@@ -1,118 +0,0 @@
1
- <%
2
- render_mode = self.render_mode
3
-
4
- setting_opts = {movement: movement_name, part: name}
5
-
6
- inline_part_title = nil
7
- if name && (name != '')
8
- part_title = Lydown::Rendering::Staff.part_title(self, setting_opts)
9
- voice_prefix = "#{name}_"
10
- else
11
- part_title = "#\"\""
12
- voice_prefix = nil
13
- end
14
- staff_id = Lydown::Rendering::Staff.staff_id(name)
15
-
16
- score_mode = render_mode == :score
17
-
18
- clef = Lydown::Rendering::Staff.clef(self, setting_opts)
19
- prevent_remove_empty = Lydown::Rendering::Staff.prevent_remove_empty(self, setting_opts)
20
-
21
- midi_mode = (self['render_opts/format'] == 'midi') ||
22
- (self['render_opts/format'] == 'mp3')
23
- midi_instrument = midi_mode && Lydown::Rendering::Staff.midi_instrument(name)
24
-
25
- beaming_mode = Lydown::Rendering::Staff.beaming_mode(self, setting_opts)
26
- partial = self.get_setting(:pickup, setting_opts)
27
- partial = partial ? "\\partial #{partial}" : ""
28
-
29
- end_barline = Lydown::Rendering::Staff.end_barline(self, setting_opts)
30
-
31
- time = self.get_setting(:time, setting_opts)
32
- cadenza = time == 'unmetered'
33
-
34
- skip_bars = (render_mode == :proof) || (render_mode == :part)
35
-
36
- instrument_names = self.get_setting(:instrument_names, setting_opts)
37
- hide_instrument_names =
38
- (instrument_names == 'hide') ||
39
- (instrument_names =~ /^inline\-?(.+)?$/)
40
-
41
- if instrument_names =~ /^inline\-?(.+)?$/
42
- alignment = $1 && "\\#{$1}"
43
- inline_part_title = Lydown::Rendering::Staff.inline_part_title(
44
- self, setting_opts.merge(alignment: alignment)
45
- )
46
- end
47
- %>
48
-
49
- <<
50
-
51
- \new Staff = <%= staff_id %> \with {
52
- <% if prevent_remove_empty %>
53
- \override VerticalAxisGroup.remove-empty = ##f
54
- <% end %>
55
- <% if size = self.get_setting(:staff_size, setting_opts) %>
56
- fontSize = #<%= size %>
57
- \override StaffSymbol.staff-space = #(magstep <%= size %>)
58
- <% end %>
59
- }
60
-
61
- \context Staff = <%= staff_id %> {
62
- <% if skip_bars %>
63
- \set Score.skipBars = ##t
64
- <% end %>
65
-
66
-
67
- <% if tempo = self.get_setting(:tempo, setting_opts) %>
68
- \tempo "<%= tempo %>"
69
- <% end %>
70
-
71
- <% if score_mode && !hide_instrument_names %>
72
- \set Staff.instrumentName = <%= part_title %>
73
- <% end %>
74
-
75
- <% if midi_instrument %>
76
- \set Staff.midiInstrument = #"<%= midi_instrument %>"
77
- <% end %>
78
-
79
- <% if clef %>
80
- \clef "<%= clef %>"
81
- <% end %>
82
- <%= partial %>
83
-
84
- <% if score_mode && inline_part_title %>
85
- <%= inline_part_title %>
86
- <% end %>
87
-
88
- <%= beaming_mode %>
89
- \<%= Lydown::Rendering.variable_name(setting_opts.merge(stream: :music)) %>
90
-
91
- <% if end_barline %>
92
- \bar "<%= end_barline %>"
93
- <% end %>
94
- }
95
-
96
- <% if part['lyrics'] %>
97
- <% multi_voice = part['lyrics'].size > 1 %>
98
- <% part['lyrics'].each_key do |voice| %>
99
- <% above_staff = multi_voice && ['voice1', 'voice3'].include?(voice) %>
100
- <% part['lyrics'][voice].keys.sort.each do |idx| %>
101
- \new Lyrics
102
- <% if above_staff %>
103
- \with { alignAboveContext = "<%= staff_id %>" }
104
- <% end %>
105
- {
106
- \lyricsto "<%= voice_prefix %><%= voice %>" {
107
- \<%= Lydown::Rendering.variable_name(setting_opts.merge(stream: :lyrics, voice: voice, idx: idx)) %>
108
- }
109
- }
110
- <% end %>
111
- <% end %>
112
-
113
- <% end %>
114
-
115
- <% if part['figures'] %>
116
- \new FiguredBass { \<%= Lydown::Rendering.variable_name(setting_opts.merge(stream: :figures)) %> }
117
- <% end %>
118
- >>
@@ -1,43 +0,0 @@
1
- <% var_name = lambda {|opts| Lydown::Rendering.variable_name(opts)} %>
2
- <% self['movements'].each do |mvt_name, mvt|
3
- mvt['parts'].each do |part_name, part|
4
- var_opts = {movement: mvt_name, part: part_name}
5
- notation_size = self.get_setting(:notation_size, var_opts)
6
-
7
- if part_name && !part_name.empty?
8
- voice_prefix = "#{part_name}_"
9
- else
10
- voice_prefix = nil
11
- end
12
- %>
13
- <%= var_name[var_opts.merge(stream: :music)] %> = \relative c {
14
- <<
15
- \new Voice = "<%= voice_prefix %>voice1" {
16
- <% if notation_size %>
17
- \<%= notation_size %>
18
- <% end %>
19
- <%= part['music'] %>
20
- }
21
- >>
22
- }
23
-
24
- <% if part['lyrics']
25
- part['lyrics'].each do |voice, voice_lyrics|
26
- voice_lyrics.each do |idx, lyrics|
27
- %>
28
- <%= var_name[var_opts.merge(stream: :lyrics, voice: voice, idx: idx)]%> = \lyricmode { <%= lyrics %> }
29
- <%
30
- end
31
- end
32
- end
33
- %>
34
- <% if part['figures']
35
- %>
36
- <%= var_name[var_opts.merge(stream: :figures)]%> = \figuremode { <%= part['figures'] %> }
37
- <%
38
- end
39
- %>
40
- <%
41
- end
42
- end
43
- %>