lydown 0.6.4 → 0.6.5
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/lib/lydown/parsing/nodes.rb +1 -1
- data/lib/lydown/rendering/command.rb +9 -4
- data/lib/lydown/rendering/defaults.yml +7 -4
- data/lib/lydown/rendering/lib.ly +32 -0
- data/lib/lydown/rendering/music.rb +6 -0
- data/lib/lydown/rendering/notes.rb +35 -4
- data/lib/lydown/rendering/settings.rb +7 -0
- data/lib/lydown/rendering.rb +3 -1
- data/lib/lydown/templates/lilypond_doc.erb +4 -0
- data/lib/lydown/version.rb +1 -1
- data/lib/lydown/work.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c68a05810e98be2fcb3b537974fca72e8ab957ee
|
4
|
+
data.tar.gz: 8fb1263e28187dcb3a2a50c5d293b8f3df03adfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3def62947a128f550444aa070c4c527452af1047adabb5d50de259a9288b518fc17deef3831e5a8c8a82a10b67b6e2f932379eb5cdf67d3b43b4fc502c4f1fa
|
7
|
+
data.tar.gz: 0baba95bf6967f19cddc306ea483fca59c09be0803996bc7f1b50170fd96a7de6523ae8cd32803240a9076d06992b4ba8bfbe806b5aaa449b604f6abb3984e81
|
data/lib/lydown/parsing/nodes.rb
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
module Lydown::Rendering
|
2
2
|
class Command < Base
|
3
|
+
include Notes
|
4
|
+
|
3
5
|
def translate
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
if @work['process/duration_macro']
|
7
|
+
add_macro_event(@event[:raw])
|
8
|
+
else
|
9
|
+
once = @event[:once] ? '\once ' : ''
|
10
|
+
cmd = "#{once}\\#{@event[:key]} #{(@event[:arguments] || []).join(' ')} "
|
11
|
+
@work.emit(:music, cmd)
|
12
|
+
end
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
@@ -123,6 +123,9 @@ parts:
|
|
123
123
|
viola-da-gamba2:
|
124
124
|
clef: bass
|
125
125
|
midi_instrument: viola
|
126
|
+
gamba:
|
127
|
+
clef: alto
|
128
|
+
midi_instrument: viola
|
126
129
|
gamba1:
|
127
130
|
clef: alto
|
128
131
|
midi_instrument: viola
|
@@ -174,11 +177,11 @@ parts:
|
|
174
177
|
midi_instrument: flute
|
175
178
|
score:
|
176
179
|
order:
|
177
|
-
- [flauto1, flauto2, flauto3, flute1, flute2, flute3]
|
178
|
-
- [oboe1, oboe2, oboe3]
|
179
|
-
- [violino1, violino2, violino3, violin1, violin2, violin3]
|
180
|
+
- [flute, flauto1, flauto2, flauto3, flute1, flute2, flute3]
|
181
|
+
- [oboe, oboe1, oboe2, oboe3]
|
182
|
+
- [violino, violino1, violino2, violino3, violin1, violin2, violin3]
|
180
183
|
- viola
|
181
|
-
- [gamba1, gamba2]
|
184
|
+
- [gamba, gamba1, gamba2]
|
182
185
|
- [soprano, alto, tenore, basso]
|
183
186
|
- [soprano1, alto1, tenore1, basso1]
|
184
187
|
- [soprano2, alto2, tenore2, basso2]
|
@@ -0,0 +1,32 @@
|
|
1
|
+
segno = {
|
2
|
+
\once \override Score.RehearsalMark #'font-size = #-2
|
3
|
+
\mark \markup { \musicglyph #"scripts.segno" }
|
4
|
+
}
|
5
|
+
|
6
|
+
segnobottom = {
|
7
|
+
\once \override Score.RehearsalMark #'direction = #DOWN
|
8
|
+
\once \override Score.RehearsalMark #'font-size = #-2
|
9
|
+
\mark \markup { \musicglyph #"scripts.segno" }
|
10
|
+
}
|
11
|
+
|
12
|
+
dalsegno = {
|
13
|
+
\once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
|
14
|
+
\once \override Score.RehearsalMark #'direction = #DOWN
|
15
|
+
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
|
16
|
+
\once \override Score.RehearsalMark #'font-size = #-2
|
17
|
+
\mark \markup { \fontsize #2 {"dal segno "} \musicglyph #"scripts.segno" }
|
18
|
+
}
|
19
|
+
|
20
|
+
dacapo = {
|
21
|
+
\once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
|
22
|
+
\once \override Score.RehearsalMark #'direction = #DOWN
|
23
|
+
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
|
24
|
+
\mark \markup {\bold {\italic {"Da capo"}}}
|
25
|
+
}
|
26
|
+
|
27
|
+
dalsegnoadlib = {
|
28
|
+
\once \override Score.RehearsalMark #'direction = #DOWN
|
29
|
+
\once \override Score.RehearsalMark #'self-alignment-X = #LEFT
|
30
|
+
\once \override Score.RehearsalMark #'font-size = #-2
|
31
|
+
\mark \markup { \musicglyph #"scripts.segno" ad lib }
|
32
|
+
}
|
@@ -9,6 +9,8 @@ module Lydown::Rendering
|
|
9
9
|
|
10
10
|
class Duration < Base
|
11
11
|
def translate
|
12
|
+
Notes.cleanup_duration_macro(@work)
|
13
|
+
|
12
14
|
# close tuplet braces
|
13
15
|
if @work['process/tuplet_mode']
|
14
16
|
TupletDuration.emit_tuplet_end(@work)
|
@@ -39,6 +41,8 @@ module Lydown::Rendering
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def translate
|
44
|
+
Notes.cleanup_duration_macro(@work)
|
45
|
+
|
42
46
|
# close tuplet braces
|
43
47
|
if @work['process/tuplet_mode']
|
44
48
|
TupletDuration.emit_tuplet_end(@work)
|
@@ -226,6 +230,8 @@ module Lydown::Rendering
|
|
226
230
|
|
227
231
|
class DurationMacro < Base
|
228
232
|
def translate
|
233
|
+
Notes.cleanup_duration_macro(@work)
|
234
|
+
|
229
235
|
if @event[:macro] =~ /^[a-zA-Z_]/
|
230
236
|
macro = @work['macros'][@event[:macro]]
|
231
237
|
if macro
|
@@ -217,7 +217,7 @@ EOF
|
|
217
217
|
event[:head], event[:octave], event[:accidental_flag],
|
218
218
|
lydown_phrasing_close(event),
|
219
219
|
event[:figures] ? "<#{event[:figures].join}>" : '',
|
220
|
-
event[:expressions] ? event[:expressions].join : ''
|
220
|
+
event[:expressions] ? event[:expressions].join + ' ' : ''
|
221
221
|
]
|
222
222
|
|
223
223
|
# replace place holder and repeaters in macro group with actual note
|
@@ -233,16 +233,47 @@ EOF
|
|
233
233
|
|
234
234
|
# if group is complete, compile it just like regular code
|
235
235
|
unless @work['process/macro_group'].include?('_')
|
236
|
-
|
236
|
+
code = LydownParser.parse(@work['process/macro_group'])
|
237
|
+
|
238
|
+
# stash macro
|
237
239
|
macro = @work['process/duration_macro']
|
238
240
|
@work['process/duration_macro'] = nil
|
241
|
+
@work['process/macro_group'] = nil
|
239
242
|
|
240
|
-
code = LydownParser.parse(@work['process/macro_group'])
|
241
243
|
@work.process(code, no_reset: true)
|
242
244
|
|
243
245
|
# restore macro
|
244
246
|
@work['process/duration_macro'] = macro
|
245
|
-
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# emits the current macro group up to the first placeholder character.
|
251
|
+
# this method is called
|
252
|
+
def self.cleanup_duration_macro(work)
|
253
|
+
return unless work['process/macro_group']
|
254
|
+
|
255
|
+
# truncate macro group up until first placeholder
|
256
|
+
group = work['process/macro_group'].sub(/_.*$/, '')
|
257
|
+
|
258
|
+
# stash macro, in order to compile macro group
|
259
|
+
macro = work['process/duration_macro']
|
260
|
+
work['process/duration_macro'] = nil
|
261
|
+
work['process/macro_group'] = nil
|
262
|
+
|
263
|
+
code = LydownParser.parse(group)
|
264
|
+
work.process(code, no_reset: true)
|
265
|
+
|
266
|
+
# restore macro
|
267
|
+
work['process/duration_macro'] = macro
|
268
|
+
end
|
269
|
+
|
270
|
+
def add_macro_event(code)
|
271
|
+
case @work['process/macro_group']
|
272
|
+
when nil
|
273
|
+
@work['process/macro_group'] = @work['process/duration_macro'].clone
|
274
|
+
@work['process/macro_group'].insert(0, " #{code} ")
|
275
|
+
when /_/
|
276
|
+
@work['process/macro_group'].sub!(/([_∞])/, " #{code} \\0")
|
246
277
|
end
|
247
278
|
end
|
248
279
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Lydown::Rendering
|
2
2
|
class Setting < Base
|
3
|
+
include Notes
|
4
|
+
|
3
5
|
SETTING_KEYS = [
|
4
6
|
'key', 'time', 'pickup', 'clef', 'part', 'movement', 'tempo',
|
5
7
|
'accidentals', 'beams', 'end_barline', 'macros', 'empty_staves'
|
@@ -16,6 +18,11 @@ module Lydown::Rendering
|
|
16
18
|
}
|
17
19
|
|
18
20
|
def translate
|
21
|
+
# if setting while doing a macro, insert it into the current macro group
|
22
|
+
if @work['process/duration_macro'] && @event[:raw]
|
23
|
+
return add_macro_event(@event[:raw])
|
24
|
+
end
|
25
|
+
|
19
26
|
key = @event[:key]
|
20
27
|
value = @event[:value]
|
21
28
|
level = @event[:level] || 0
|
data/lib/lydown/rendering.rb
CHANGED
data/lib/lydown/version.rb
CHANGED
data/lib/lydown/work.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lydown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/lydown/rendering/comments.rb
|
48
48
|
- lib/lydown/rendering/defaults.yml
|
49
49
|
- lib/lydown/rendering/figures.rb
|
50
|
+
- lib/lydown/rendering/lib.ly
|
50
51
|
- lib/lydown/rendering/lyrics.rb
|
51
52
|
- lib/lydown/rendering/movement.rb
|
52
53
|
- lib/lydown/rendering/music.rb
|