musicality 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +27 -1
- data/README.md +153 -10
- data/bin/collidify +102 -0
- data/bin/lilify +57 -29
- data/bin/midify +64 -24
- data/bin/musicality +39 -0
- data/examples/composition/auto_counterpoint.rb +4 -5
- data/examples/composition/part_generator.rb +8 -2
- data/examples/composition/scale_exercise.rb +1 -1
- data/examples/notation/notes.rb +27 -0
- data/examples/notation/parts.rb +51 -0
- data/examples/notation/scores.rb +38 -0
- data/examples/notation/twinkle.rb +34 -0
- data/examples/notation/twinkle.score +33 -0
- data/lib/musicality.rb +46 -11
- data/lib/musicality/composition/dsl/score_dsl.rb +2 -2
- data/lib/musicality/composition/dsl/score_methods.rb +10 -7
- data/lib/musicality/notation/conversion/change_conversion.rb +1 -1
- data/lib/musicality/notation/conversion/note_time_converter.rb +6 -23
- data/lib/musicality/notation/conversion/score_conversion.rb +15 -15
- data/lib/musicality/notation/conversion/score_converter.rb +50 -67
- data/lib/musicality/notation/model/articulations.rb +3 -2
- data/lib/musicality/notation/model/change.rb +15 -6
- data/lib/musicality/notation/model/dynamics.rb +11 -8
- data/lib/musicality/notation/model/instrument.rb +61 -0
- data/lib/musicality/notation/model/instruments.rb +111 -0
- data/lib/musicality/notation/model/key.rb +137 -0
- data/lib/musicality/notation/model/keys.rb +37 -0
- data/lib/musicality/notation/model/link.rb +6 -19
- data/lib/musicality/notation/model/mark.rb +43 -0
- data/lib/musicality/notation/model/marks.rb +11 -0
- data/lib/musicality/notation/model/meter.rb +4 -0
- data/lib/musicality/notation/model/note.rb +42 -28
- data/lib/musicality/notation/model/part.rb +18 -5
- data/lib/musicality/notation/model/pitch.rb +13 -4
- data/lib/musicality/notation/model/score.rb +104 -66
- data/lib/musicality/notation/model/symbols.rb +16 -11
- data/lib/musicality/notation/parsing/articulation_parsing.rb +38 -38
- data/lib/musicality/notation/parsing/articulation_parsing.treetop +14 -14
- data/lib/musicality/notation/parsing/link_parsing.rb +6 -6
- data/lib/musicality/notation/parsing/link_parsing.treetop +3 -3
- data/lib/musicality/notation/parsing/mark_parsing.rb +138 -0
- data/lib/musicality/notation/parsing/mark_parsing.treetop +31 -0
- data/lib/musicality/notation/parsing/note_node.rb +19 -12
- data/lib/musicality/notation/parsing/note_parsing.rb +218 -87
- data/lib/musicality/notation/parsing/note_parsing.treetop +9 -5
- data/lib/musicality/notation/parsing/numbers/nonnegative_integer_parsing.rb +7 -2
- data/lib/musicality/notation/parsing/numbers/nonnegative_integer_parsing.treetop +1 -1
- data/lib/musicality/notation/parsing/numbers/positive_integer_parsing.rb +6 -4
- data/lib/musicality/notation/parsing/numbers/positive_integer_parsing.treetop +1 -1
- data/lib/musicality/notation/util/function.rb +41 -18
- data/lib/musicality/packable.rb +156 -0
- data/lib/musicality/performance/conversion/glissando_converter.rb +2 -2
- data/lib/musicality/performance/conversion/note_sequence_extractor.rb +223 -70
- data/lib/musicality/performance/conversion/portamento_converter.rb +5 -2
- data/lib/musicality/performance/conversion/score_collator.rb +70 -64
- data/lib/musicality/performance/midi/midi_events.rb +3 -3
- data/lib/musicality/performance/midi/midi_settings.rb +127 -0
- data/lib/musicality/performance/midi/midi_util.rb +8 -2
- data/lib/musicality/performance/midi/part_sequencer.rb +19 -18
- data/lib/musicality/performance/midi/score_sequencer.rb +13 -9
- data/lib/musicality/performance/midi/score_sequencing.rb +5 -5
- data/lib/musicality/performance/model/attack.rb +8 -0
- data/lib/musicality/performance/model/duration_functions.rb +23 -0
- data/lib/musicality/performance/model/note_sequence.rb +52 -95
- data/lib/musicality/performance/model/separation.rb +10 -0
- data/lib/musicality/performance/supercollider/add_actions.rb +13 -0
- data/lib/musicality/performance/supercollider/bundle.rb +18 -0
- data/lib/musicality/performance/supercollider/conductor.rb +125 -0
- data/lib/musicality/performance/supercollider/group.rb +71 -0
- data/lib/musicality/performance/supercollider/message.rb +26 -0
- data/lib/musicality/performance/supercollider/node.rb +122 -0
- data/lib/musicality/performance/supercollider/performer.rb +123 -0
- data/lib/musicality/performance/supercollider/score_conducting.rb +17 -0
- data/lib/musicality/performance/supercollider/server.rb +8 -0
- data/lib/musicality/performance/supercollider/synth.rb +43 -0
- data/lib/musicality/performance/supercollider/synthdef.rb +57 -0
- data/lib/musicality/performance/supercollider/synthdef_settings.rb +23 -0
- data/lib/musicality/performance/supercollider/synthdefs.rb +1654 -0
- data/lib/musicality/{composition/model/pitch_class.rb → pitch_class.rb} +1 -1
- data/lib/musicality/{composition/model/pitch_classes.rb → pitch_classes.rb} +9 -9
- data/lib/musicality/printing/lilypond/clef.rb +12 -0
- data/lib/musicality/printing/lilypond/key_engraving.rb +9 -0
- data/lib/musicality/printing/lilypond/lilypond_settings.rb +105 -0
- data/lib/musicality/printing/lilypond/meter_engraving.rb +1 -1
- data/lib/musicality/printing/lilypond/note_engraving.rb +112 -30
- data/lib/musicality/printing/lilypond/part_engraver.rb +114 -3
- data/lib/musicality/printing/lilypond/pitch_class_engraving.rb +22 -0
- data/lib/musicality/printing/lilypond/pitch_engraving.rb +2 -15
- data/lib/musicality/printing/lilypond/score_engraver.rb +44 -73
- data/lib/musicality/printing/lilypond/score_engraving.rb +3 -3
- data/lib/musicality/project/create_tasks.rb +31 -0
- data/lib/musicality/project/file_cleaner.rb +19 -0
- data/lib/musicality/project/file_raker.rb +107 -0
- data/lib/musicality/project/load_config.rb +43 -0
- data/lib/musicality/project/project.rb +64 -0
- data/lib/musicality/version.rb +1 -1
- data/musicality.gemspec +3 -0
- data/spec/composition/util/random_sampler_spec.rb +1 -1
- data/spec/notation/conversion/measure_note_map_spec.rb +1 -1
- data/spec/notation/conversion/note_time_converter_spec.rb +5 -85
- data/spec/notation/conversion/score_conversion_spec.rb +6 -41
- data/spec/notation/conversion/score_converter_spec.rb +19 -137
- data/spec/notation/model/change_spec.rb +55 -0
- data/spec/notation/model/key_spec.rb +171 -0
- data/spec/notation/model/link_spec.rb +34 -5
- data/spec/notation/model/meter_spec.rb +15 -0
- data/spec/notation/model/note_spec.rb +33 -27
- data/spec/notation/model/part_spec.rb +53 -4
- data/spec/notation/model/pitch_spec.rb +15 -0
- data/spec/notation/model/score_spec.rb +64 -72
- data/spec/notation/parsing/link_nodes_spec.rb +3 -3
- data/spec/notation/parsing/link_parsing_spec.rb +6 -6
- data/spec/notation/parsing/note_node_spec.rb +34 -9
- data/spec/notation/parsing/note_parsing_spec.rb +11 -9
- data/spec/notation/parsing/numbers/nonnegative_integer_spec.rb +4 -0
- data/spec/notation/parsing/pitch_node_spec.rb +0 -1
- data/spec/notation/util/value_computer_spec.rb +2 -2
- data/spec/performance/conversion/glissando_converter_spec.rb +9 -9
- data/spec/performance/conversion/note_sequence_extractor_spec.rb +48 -53
- data/spec/performance/conversion/portamento_converter_spec.rb +11 -9
- data/spec/performance/conversion/score_collator_spec.rb +59 -63
- data/spec/performance/midi/midi_util_spec.rb +22 -8
- data/spec/performance/midi/part_sequencer_spec.rb +2 -2
- data/spec/performance/midi/score_sequencer_spec.rb +12 -10
- data/spec/performance/midi/score_sequencing_spec.rb +2 -2
- data/spec/performance/model/note_sequence_spec.rb +41 -134
- data/spec/printing/note_engraving_spec.rb +204 -0
- data/spec/printing/score_engraver_spec.rb +40 -0
- data/spec/spec_helper.rb +1 -0
- metadata +69 -23
- data/examples/notation/hip.rb +0 -32
- data/examples/notation/missed_connection.rb +0 -26
- data/examples/notation/song1.rb +0 -33
- data/examples/notation/song2.rb +0 -32
- data/lib/musicality/notation/model/links.rb +0 -11
- data/lib/musicality/notation/packing/change_packing.rb +0 -56
- data/lib/musicality/notation/packing/part_packing.rb +0 -31
- data/lib/musicality/notation/packing/score_packing.rb +0 -123
- data/lib/musicality/performance/model/note_attacks.rb +0 -19
- data/lib/musicality/performance/util/note_linker.rb +0 -28
- data/spec/notation/packing/change_packing_spec.rb +0 -304
- data/spec/notation/packing/part_packing_spec.rb +0 -66
- data/spec/notation/packing/score_packing_spec.rb +0 -255
- data/spec/performance/util/note_linker_spec.rb +0 -68
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe ScoreEngraver do
|
4
|
+
describe '.part_titles' do
|
5
|
+
context 'parts all have different lilypond settings' do
|
6
|
+
it 'should return a map of part names to instrument names' do
|
7
|
+
parts = {
|
8
|
+
:part1 => Part.new(Dynamics::MP, settings: [ LilypondSettings::ELECTRIC_PIANO ]),
|
9
|
+
:part2 => Part.new(Dynamics::MP, settings: [ LilypondSettings::ELECTRIC_BASS ]),
|
10
|
+
:part3 => Part.new(Dynamics::MP, settings: [ LilypondSettings::CLARINET ])
|
11
|
+
}
|
12
|
+
titles = ScoreEngraver.figure_part_titles(parts)
|
13
|
+
|
14
|
+
parts.each do |part_name, part|
|
15
|
+
titles[part_name].should eq(part.lilypond_settings.instrument_name)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'some parts have same lilypond settings' do
|
21
|
+
it 'should return a map of part names to numbered instrument names' do
|
22
|
+
parts = {
|
23
|
+
:part1 => Part.new(Dynamics::MP, settings: [ LilypondSettings::ELECTRIC_PIANO ]),
|
24
|
+
:part2 => Part.new(Dynamics::MP, settings: [ LilypondSettings::ELECTRIC_PIANO ]),
|
25
|
+
:part3 => Part.new(Dynamics::MP, settings: [ LilypondSettings::ELECTRIC_PIANO ])
|
26
|
+
}
|
27
|
+
titles = ScoreEngraver.figure_part_titles(parts)
|
28
|
+
|
29
|
+
part_nums = []
|
30
|
+
parts.each do |part_name, part|
|
31
|
+
r = Regexp.new("#{part.lilypond_settings.instrument_name} (\\d)")
|
32
|
+
titles[part_name].should match r
|
33
|
+
m = titles[part_name].match(r)
|
34
|
+
part_nums.push m.captures.first.to_s.to_i
|
35
|
+
end
|
36
|
+
part_nums.sort.should eq((1..part_nums.size).to_a)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: musicality
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Tunnell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.5'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: ruby-osc
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.4'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.4'
|
111
125
|
description: "The library is based around an abstract representation for music notation.
|
112
126
|
\\\n From here, functions are built up to make composing
|
113
127
|
elaborate pieces in this notation representation more manageable. \\\n Finally,
|
@@ -116,8 +130,10 @@ description: "The library is based around an abstract representation for music n
|
|
116
130
|
email:
|
117
131
|
- jamestunnell@gmail.com
|
118
132
|
executables:
|
133
|
+
- collidify
|
119
134
|
- lilify
|
120
135
|
- midify
|
136
|
+
- musicality
|
121
137
|
extensions: []
|
122
138
|
extra_rdoc_files: []
|
123
139
|
files:
|
@@ -129,23 +145,24 @@ files:
|
|
129
145
|
- LICENSE.txt
|
130
146
|
- README.md
|
131
147
|
- Rakefile
|
148
|
+
- bin/collidify
|
132
149
|
- bin/lilify
|
133
150
|
- bin/midify
|
151
|
+
- bin/musicality
|
134
152
|
- examples/composition/auto_counterpoint.rb
|
135
153
|
- examples/composition/part_generator.rb
|
136
154
|
- examples/composition/scale_exercise.rb
|
137
|
-
- examples/notation/
|
138
|
-
- examples/notation/
|
139
|
-
- examples/notation/
|
140
|
-
- examples/notation/
|
155
|
+
- examples/notation/notes.rb
|
156
|
+
- examples/notation/parts.rb
|
157
|
+
- examples/notation/scores.rb
|
158
|
+
- examples/notation/twinkle.rb
|
159
|
+
- examples/notation/twinkle.score
|
141
160
|
- lib/musicality.rb
|
142
161
|
- lib/musicality/composition/convenience_methods.rb
|
143
162
|
- lib/musicality/composition/dsl/score_dsl.rb
|
144
163
|
- lib/musicality/composition/dsl/score_methods.rb
|
145
164
|
- lib/musicality/composition/generation/counterpoint_generator.rb
|
146
165
|
- lib/musicality/composition/generation/random_rhythm_generator.rb
|
147
|
-
- lib/musicality/composition/model/pitch_class.rb
|
148
|
-
- lib/musicality/composition/model/pitch_classes.rb
|
149
166
|
- lib/musicality/composition/model/scale.rb
|
150
167
|
- lib/musicality/composition/model/scale_class.rb
|
151
168
|
- lib/musicality/composition/model/scale_classes.rb
|
@@ -166,8 +183,13 @@ files:
|
|
166
183
|
- lib/musicality/notation/model/articulations.rb
|
167
184
|
- lib/musicality/notation/model/change.rb
|
168
185
|
- lib/musicality/notation/model/dynamics.rb
|
186
|
+
- lib/musicality/notation/model/instrument.rb
|
187
|
+
- lib/musicality/notation/model/instruments.rb
|
188
|
+
- lib/musicality/notation/model/key.rb
|
189
|
+
- lib/musicality/notation/model/keys.rb
|
169
190
|
- lib/musicality/notation/model/link.rb
|
170
|
-
- lib/musicality/notation/model/
|
191
|
+
- lib/musicality/notation/model/mark.rb
|
192
|
+
- lib/musicality/notation/model/marks.rb
|
171
193
|
- lib/musicality/notation/model/meter.rb
|
172
194
|
- lib/musicality/notation/model/meters.rb
|
173
195
|
- lib/musicality/notation/model/note.rb
|
@@ -176,9 +198,6 @@ files:
|
|
176
198
|
- lib/musicality/notation/model/pitches.rb
|
177
199
|
- lib/musicality/notation/model/score.rb
|
178
200
|
- lib/musicality/notation/model/symbols.rb
|
179
|
-
- lib/musicality/notation/packing/change_packing.rb
|
180
|
-
- lib/musicality/notation/packing/part_packing.rb
|
181
|
-
- lib/musicality/notation/packing/score_packing.rb
|
182
201
|
- lib/musicality/notation/parsing/articulation_parsing.rb
|
183
202
|
- lib/musicality/notation/parsing/articulation_parsing.treetop
|
184
203
|
- lib/musicality/notation/parsing/convenience_methods.rb
|
@@ -188,6 +207,8 @@ files:
|
|
188
207
|
- lib/musicality/notation/parsing/link_nodes.rb
|
189
208
|
- lib/musicality/notation/parsing/link_parsing.rb
|
190
209
|
- lib/musicality/notation/parsing/link_parsing.treetop
|
210
|
+
- lib/musicality/notation/parsing/mark_parsing.rb
|
211
|
+
- lib/musicality/notation/parsing/mark_parsing.treetop
|
191
212
|
- lib/musicality/notation/parsing/meter_parsing.rb
|
192
213
|
- lib/musicality/notation/parsing/meter_parsing.treetop
|
193
214
|
- lib/musicality/notation/parsing/note_node.rb
|
@@ -216,26 +237,53 @@ files:
|
|
216
237
|
- lib/musicality/notation/util/piecewise_function.rb
|
217
238
|
- lib/musicality/notation/util/transition.rb
|
218
239
|
- lib/musicality/notation/util/value_computer.rb
|
240
|
+
- lib/musicality/packable.rb
|
219
241
|
- lib/musicality/performance/conversion/glissando_converter.rb
|
220
242
|
- lib/musicality/performance/conversion/note_sequence_extractor.rb
|
221
243
|
- lib/musicality/performance/conversion/portamento_converter.rb
|
222
244
|
- lib/musicality/performance/conversion/score_collator.rb
|
223
245
|
- lib/musicality/performance/midi/midi_events.rb
|
246
|
+
- lib/musicality/performance/midi/midi_settings.rb
|
224
247
|
- lib/musicality/performance/midi/midi_util.rb
|
225
248
|
- lib/musicality/performance/midi/part_sequencer.rb
|
226
249
|
- lib/musicality/performance/midi/score_sequencer.rb
|
227
250
|
- lib/musicality/performance/midi/score_sequencing.rb
|
228
|
-
- lib/musicality/performance/model/
|
251
|
+
- lib/musicality/performance/model/attack.rb
|
252
|
+
- lib/musicality/performance/model/duration_functions.rb
|
229
253
|
- lib/musicality/performance/model/note_sequence.rb
|
230
|
-
- lib/musicality/performance/
|
254
|
+
- lib/musicality/performance/model/separation.rb
|
255
|
+
- lib/musicality/performance/supercollider/add_actions.rb
|
256
|
+
- lib/musicality/performance/supercollider/bundle.rb
|
257
|
+
- lib/musicality/performance/supercollider/conductor.rb
|
258
|
+
- lib/musicality/performance/supercollider/group.rb
|
259
|
+
- lib/musicality/performance/supercollider/message.rb
|
260
|
+
- lib/musicality/performance/supercollider/node.rb
|
261
|
+
- lib/musicality/performance/supercollider/performer.rb
|
262
|
+
- lib/musicality/performance/supercollider/score_conducting.rb
|
263
|
+
- lib/musicality/performance/supercollider/server.rb
|
264
|
+
- lib/musicality/performance/supercollider/synth.rb
|
265
|
+
- lib/musicality/performance/supercollider/synthdef.rb
|
266
|
+
- lib/musicality/performance/supercollider/synthdef_settings.rb
|
267
|
+
- lib/musicality/performance/supercollider/synthdefs.rb
|
231
268
|
- lib/musicality/performance/util/optimization.rb
|
269
|
+
- lib/musicality/pitch_class.rb
|
270
|
+
- lib/musicality/pitch_classes.rb
|
271
|
+
- lib/musicality/printing/lilypond/clef.rb
|
232
272
|
- lib/musicality/printing/lilypond/errors.rb
|
273
|
+
- lib/musicality/printing/lilypond/key_engraving.rb
|
274
|
+
- lib/musicality/printing/lilypond/lilypond_settings.rb
|
233
275
|
- lib/musicality/printing/lilypond/meter_engraving.rb
|
234
276
|
- lib/musicality/printing/lilypond/note_engraving.rb
|
235
277
|
- lib/musicality/printing/lilypond/part_engraver.rb
|
278
|
+
- lib/musicality/printing/lilypond/pitch_class_engraving.rb
|
236
279
|
- lib/musicality/printing/lilypond/pitch_engraving.rb
|
237
280
|
- lib/musicality/printing/lilypond/score_engraver.rb
|
238
281
|
- lib/musicality/printing/lilypond/score_engraving.rb
|
282
|
+
- lib/musicality/project/create_tasks.rb
|
283
|
+
- lib/musicality/project/file_cleaner.rb
|
284
|
+
- lib/musicality/project/file_raker.rb
|
285
|
+
- lib/musicality/project/load_config.rb
|
286
|
+
- lib/musicality/project/project.rb
|
239
287
|
- lib/musicality/validatable.rb
|
240
288
|
- lib/musicality/version.rb
|
241
289
|
- musicality.gemspec
|
@@ -259,15 +307,13 @@ files:
|
|
259
307
|
- spec/notation/conversion/score_converter_spec.rb
|
260
308
|
- spec/notation/conversion/tempo_conversion_spec.rb
|
261
309
|
- spec/notation/model/change_spec.rb
|
310
|
+
- spec/notation/model/key_spec.rb
|
262
311
|
- spec/notation/model/link_spec.rb
|
263
312
|
- spec/notation/model/meter_spec.rb
|
264
313
|
- spec/notation/model/note_spec.rb
|
265
314
|
- spec/notation/model/part_spec.rb
|
266
315
|
- spec/notation/model/pitch_spec.rb
|
267
316
|
- spec/notation/model/score_spec.rb
|
268
|
-
- spec/notation/packing/change_packing_spec.rb
|
269
|
-
- spec/notation/packing/part_packing_spec.rb
|
270
|
-
- spec/notation/packing/score_packing_spec.rb
|
271
317
|
- spec/notation/parsing/articulation_parsing_spec.rb
|
272
318
|
- spec/notation/parsing/convenience_methods_spec.rb
|
273
319
|
- spec/notation/parsing/duration_nodes_spec.rb
|
@@ -298,8 +344,9 @@ files:
|
|
298
344
|
- spec/performance/midi/score_sequencer_spec.rb
|
299
345
|
- spec/performance/midi/score_sequencing_spec.rb
|
300
346
|
- spec/performance/model/note_sequence_spec.rb
|
301
|
-
- spec/performance/util/note_linker_spec.rb
|
302
347
|
- spec/performance/util/optimization_spec.rb
|
348
|
+
- spec/printing/note_engraving_spec.rb
|
349
|
+
- spec/printing/score_engraver_spec.rb
|
303
350
|
- spec/spec_helper.rb
|
304
351
|
homepage: https://github.com/jamestunnell/musicality
|
305
352
|
licenses:
|
@@ -313,7 +360,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
313
360
|
requirements:
|
314
361
|
- - '>='
|
315
362
|
- !ruby/object:Gem::Version
|
316
|
-
version: '0'
|
363
|
+
version: '2.0'
|
317
364
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
318
365
|
requirements:
|
319
366
|
- - '>='
|
@@ -346,15 +393,13 @@ test_files:
|
|
346
393
|
- spec/notation/conversion/score_converter_spec.rb
|
347
394
|
- spec/notation/conversion/tempo_conversion_spec.rb
|
348
395
|
- spec/notation/model/change_spec.rb
|
396
|
+
- spec/notation/model/key_spec.rb
|
349
397
|
- spec/notation/model/link_spec.rb
|
350
398
|
- spec/notation/model/meter_spec.rb
|
351
399
|
- spec/notation/model/note_spec.rb
|
352
400
|
- spec/notation/model/part_spec.rb
|
353
401
|
- spec/notation/model/pitch_spec.rb
|
354
402
|
- spec/notation/model/score_spec.rb
|
355
|
-
- spec/notation/packing/change_packing_spec.rb
|
356
|
-
- spec/notation/packing/part_packing_spec.rb
|
357
|
-
- spec/notation/packing/score_packing_spec.rb
|
358
403
|
- spec/notation/parsing/articulation_parsing_spec.rb
|
359
404
|
- spec/notation/parsing/convenience_methods_spec.rb
|
360
405
|
- spec/notation/parsing/duration_nodes_spec.rb
|
@@ -385,6 +430,7 @@ test_files:
|
|
385
430
|
- spec/performance/midi/score_sequencer_spec.rb
|
386
431
|
- spec/performance/midi/score_sequencing_spec.rb
|
387
432
|
- spec/performance/model/note_sequence_spec.rb
|
388
|
-
- spec/performance/util/note_linker_spec.rb
|
389
433
|
- spec/performance/util/optimization_spec.rb
|
434
|
+
- spec/printing/note_engraving_spec.rb
|
435
|
+
- spec/printing/score_engraver_spec.rb
|
390
436
|
- spec/spec_helper.rb
|
data/examples/notation/hip.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'musicality'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
include Musicality
|
5
|
-
include Pitches
|
6
|
-
include Articulations
|
7
|
-
include Meters
|
8
|
-
|
9
|
-
score = Score::Measured.new(FOUR_FOUR,120) do |s|
|
10
|
-
s.program += [0...2, 0...2, 2...4, 0...2]
|
11
|
-
s.parts["lead"] = Part.new(Dynamics::MF) do |p|
|
12
|
-
riff = "/6Bb3 /4 /12Db4= /6Db4= /36Db4 /36Eb4 /36Db4 /6Ab3 /12Db4 \
|
13
|
-
/6Bb3 /4 /12Db4= /4Db4= /8=Db4 /8C4".to_notes
|
14
|
-
p.notes = riff + riff.map {|n| n.transpose(2) }
|
15
|
-
end
|
16
|
-
|
17
|
-
s.parts["bass"] = Part.new(Dynamics::MP) do |p|
|
18
|
-
riff = "/6Bb2 /4 /3Ab2 /6F2 /12Ab2 \
|
19
|
-
/6Bb2 /4 /3Ab2 /4Ab2".to_notes
|
20
|
-
p.notes = riff + riff.map {|n| n.transpose(2) }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
name = File.basename(__FILE__,".rb")
|
25
|
-
|
26
|
-
File.open("#{name}.yml", "w") do |file|
|
27
|
-
file.write score.to_yaml
|
28
|
-
end
|
29
|
-
|
30
|
-
File.open("#{name}_packed.yml", "w") do |file|
|
31
|
-
file.write score.pack.to_yaml
|
32
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'musicality'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
include Musicality
|
5
|
-
include Pitches
|
6
|
-
include Articulations
|
7
|
-
include Meters
|
8
|
-
|
9
|
-
score = Score::Measured.new(FOUR_FOUR, 120) do |s|
|
10
|
-
s.program += [0...2, 0...6]
|
11
|
-
s.parts["bass"] = Part.new(Dynamics::MF) do |p|
|
12
|
-
p.notes = "/4Eb2 /4 /4Bb2 /4 /4Eb2 /8 /8B2 /4Bb2 /4Ab2".to_notes
|
13
|
-
p.notes += "/4Bb2 /8 /8F3= /2F3 /4Bb2 /8 /8F3= /2F3".to_notes
|
14
|
-
p.notes += "/4B2 /8 /8Gb3= /2Gb3 /8 /8Gb3= /2Gb3".to_notes
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
name = File.basename(__FILE__,".rb")
|
19
|
-
|
20
|
-
File.open("#{name}.yml", "w") do |file|
|
21
|
-
file.write score.to_yaml
|
22
|
-
end
|
23
|
-
|
24
|
-
File.open("#{name}_packed.yml", "w") do |file|
|
25
|
-
file.write score.pack.to_yaml
|
26
|
-
end
|
data/examples/notation/song1.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'musicality'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
include Musicality
|
5
|
-
include Pitches
|
6
|
-
include Articulations
|
7
|
-
include Meters
|
8
|
-
|
9
|
-
score = Score::Measured.new(FOUR_FOUR, 120) do |s|
|
10
|
-
s.program += [0...4]*2
|
11
|
-
|
12
|
-
s.parts[1] = Part.new(Dynamics::MF) do |p|
|
13
|
-
p.notes = "3/8C2 /4Eb2 5/16F2 /16Eb2 \
|
14
|
-
/8 /4C2 /4Eb2 3/8 \
|
15
|
-
3/8C2 /4Eb2 5/16F2 /16Eb2 \
|
16
|
-
/8 /4C2 /4Eb2".to_notes
|
17
|
-
end
|
18
|
-
|
19
|
-
s.parts[2] = Part.new(Dynamics::MF) do |p|
|
20
|
-
p.notes = "/8 /8Bb3 /8Bb3 /8Bb3 /8Bb3 /4C4 /4A3 /8G3 /8F3 5/16=G3 /16=F3 /8E3 /8 \
|
21
|
-
/8 /8Bb3 /8Bb3 /8Bb3 /8Bb3 /4C4 /8A3 /8E4 /8=E4 /8=D4 /8C4".to_notes
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
name = File.basename(__FILE__,".rb")
|
26
|
-
|
27
|
-
File.open("#{name}.yml", "w") do |file|
|
28
|
-
file.write score.to_yaml
|
29
|
-
end
|
30
|
-
|
31
|
-
File.open("#{name}_packed.yml", "w") do |file|
|
32
|
-
file.write score.pack.to_yaml
|
33
|
-
end
|
data/examples/notation/song2.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'musicality'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
include Musicality
|
5
|
-
include Pitches
|
6
|
-
include Meters
|
7
|
-
|
8
|
-
score = Score::Measured.new(FOUR_FOUR, 120) do |s|
|
9
|
-
s.program += [0...4]*2
|
10
|
-
|
11
|
-
s.parts[1] = Part.new(Dynamics::MF) do |p|
|
12
|
-
p.notes = "1C4 1Bb3 1Ab3 /2G3 /2Bb3".to_notes
|
13
|
-
end
|
14
|
-
|
15
|
-
s.parts[2] = Part.new(Dynamics::MF) do |p|
|
16
|
-
p.notes = "3/8E5 1D5 1C5 5/8C5 /2C5 /2D5".to_notes
|
17
|
-
end
|
18
|
-
|
19
|
-
s.parts[3] = Part.new(Dynamics::MF) do |p|
|
20
|
-
p.notes = "/8 /4G5 /2F5 /4 /4F5 /2Eb5 /4 /4Eb5 /2Eb5 /8 /2Eb5 /2F5".to_notes
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
name = File.basename(__FILE__,".rb")
|
25
|
-
|
26
|
-
File.open("#{name}.yml", "w") do |file|
|
27
|
-
file.write score.to_yaml
|
28
|
-
end
|
29
|
-
|
30
|
-
File.open("#{name}_packed.yml", "w") do |file|
|
31
|
-
file.write score.pack.to_yaml
|
32
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
module Musicality
|
2
|
-
|
3
|
-
class Change
|
4
|
-
class Immediate < Change
|
5
|
-
def change_type_str; "Immediate"; end
|
6
|
-
def pack with: nil
|
7
|
-
super(:with => with)
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.unpack(packing, with: nil)
|
11
|
-
end_val = packing["end_value"]
|
12
|
-
new(with.nil? ? end_val : end_val.send(with))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class Gradual < Change
|
17
|
-
def change_type_str; "Gradual"; end
|
18
|
-
def pack with: nil
|
19
|
-
packing = super(:with => with)
|
20
|
-
packing.merge!("duration" => @duration, "transition" => @transition)
|
21
|
-
unless @start_value.nil?
|
22
|
-
packing["start_value"] = with.nil? ? @start_value : @start_value.send(with)
|
23
|
-
end
|
24
|
-
return packing
|
25
|
-
end
|
26
|
-
def self.unpack packing, with: nil
|
27
|
-
start_val, end_val = packing["start_value"], packing["end_value"]
|
28
|
-
new(with.nil? ? end_val : end_val.send(with),
|
29
|
-
packing["duration"], packing["transition"],
|
30
|
-
start_value: (start_val.nil? || with.nil?) ? start_val : start_val.send(with))
|
31
|
-
end
|
32
|
-
|
33
|
-
class Trimmed < Gradual
|
34
|
-
def change_type_str; "Gradual::Trimmed"; end
|
35
|
-
def pack with: nil
|
36
|
-
super(:with => with).merge("preceding" => @preceding, "remaining" => @remaining)
|
37
|
-
end
|
38
|
-
def self.unpack packing, with: nil
|
39
|
-
Gradual.unpack(packing, :with => with).to_trimmed(
|
40
|
-
packing["preceding"], packing["remaining"])
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def pack with: nil
|
46
|
-
{ "end_value" => (with.nil? ? @end_value : @end_value.send(with)),
|
47
|
-
"type" => self.change_type_str }
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.unpack packing, with: nil
|
51
|
-
type = const_get(packing["type"])
|
52
|
-
type.unpack(packing, with: with)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|