musicality 0.10.1 → 0.11.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 +13 -3
- data/README.md +8 -8
- data/bin/auditions +241 -0
- data/bin/collidify +4 -2
- data/bin/musicality +13 -2
- data/examples/composition/auto_counterpoint.rb +4 -4
- data/examples/composition/part_generator.rb +6 -6
- data/examples/composition/scale_exercise.rb +5 -5
- data/examples/notation/scores.rb +2 -2
- data/examples/notation/twinkle.rb +6 -6
- data/examples/notation/twinkle.score +3 -3
- data/lib/musicality.rb +6 -4
- data/lib/musicality/composition/dsl/part_methods.rb +12 -0
- data/lib/musicality/composition/dsl/score_dsl.rb +4 -4
- data/lib/musicality/composition/dsl/score_methods.rb +8 -2
- data/lib/musicality/notation/model/audition.rb +16 -0
- data/lib/musicality/notation/model/score.rb +31 -30
- data/lib/musicality/performance/supercollider/conductor.rb +2 -2
- data/lib/musicality/performance/supercollider/synthdefs.rb +30 -29
- data/lib/musicality/project/auditions_task.rb +28 -0
- data/lib/musicality/project/create_tasks.rb +15 -9
- data/lib/musicality/project/file_cleaner.rb +22 -5
- data/lib/musicality/project/file_raker.rb +29 -21
- data/lib/musicality/project/project.rb +218 -32
- data/lib/musicality/version.rb +1 -1
- data/musicality.gemspec +6 -4
- data/spec/composition/dsl/part_methods_spec.rb +24 -0
- data/spec/notation/conversion/score_conversion_spec.rb +2 -1
- data/spec/notation/conversion/score_converter_spec.rb +23 -23
- data/spec/notation/model/score_spec.rb +66 -46
- data/spec/performance/conversion/score_collator_spec.rb +29 -29
- data/spec/performance/midi/score_sequencing_spec.rb +5 -5
- metadata +10 -8
- data/lib/musicality/project/load_config.rb +0 -58
@@ -6,30 +6,30 @@ describe Score::Timed do
|
|
6
6
|
"/2A4 "*2 + "1G4").to_notes
|
7
7
|
end
|
8
8
|
s.parts["lhand"] = Part.new(Dynamics::MF) do |p|
|
9
|
-
p.notes += ("1C3,E3,G3 "*2 +
|
9
|
+
p.notes += ("1C3,E3,G3 "*2 +
|
10
10
|
"1F2,A2,C3 1C3,E3,G3").to_notes
|
11
11
|
end
|
12
12
|
s.program.push 0...8
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
describe '#to_midi_seq' do
|
17
17
|
it 'should produce a MIDI::Sequence' do
|
18
18
|
seq = @score.to_midi_seq
|
19
19
|
seq.should be_a MIDI::Sequence
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
22
22
|
end
|
23
23
|
|
24
24
|
describe Score::Tempo do
|
25
25
|
before :all do
|
26
|
-
@score = Score::Tempo.new(
|
26
|
+
@score = Score::Tempo.new(120) do |s|
|
27
27
|
s.parts["rhand"] = Part.new(Dynamics::MF) do |p|
|
28
28
|
p.notes += ("/4C4 "*2 + "/4G4 "*2 +
|
29
29
|
"/4A4 "*2 + "/2G4").to_notes
|
30
30
|
end
|
31
31
|
s.parts["lhand"] = Part.new(Dynamics::MF) do |p|
|
32
|
-
p.notes += ("/2C3,E3,G3 "*2 +
|
32
|
+
p.notes += ("/2C3,E3,G3 "*2 +
|
33
33
|
"/2F2,A2,C3 /2C3,E3,G3").to_notes
|
34
34
|
end
|
35
35
|
s.program.push 0...4
|
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.11.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: 2016-
|
11
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,14 +122,11 @@ dependencies:
|
|
122
122
|
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.9'
|
125
|
-
description:
|
126
|
-
\\\n From here, functions are built up to make composing
|
127
|
-
elaborate pieces in this notation representation more manageable. \\\n Finally,
|
128
|
-
music performance is supported by providing translation to common formats, like
|
129
|
-
MIDI. "
|
125
|
+
description: 'The library is based around an abstract representation '
|
130
126
|
email:
|
131
127
|
- jamestunnell@gmail.com
|
132
128
|
executables:
|
129
|
+
- auditions
|
133
130
|
- collidify
|
134
131
|
- lilify
|
135
132
|
- midify
|
@@ -145,6 +142,7 @@ files:
|
|
145
142
|
- LICENSE.txt
|
146
143
|
- README.md
|
147
144
|
- Rakefile
|
145
|
+
- bin/auditions
|
148
146
|
- bin/collidify
|
149
147
|
- bin/lilify
|
150
148
|
- bin/midify
|
@@ -159,6 +157,7 @@ files:
|
|
159
157
|
- examples/notation/twinkle.score
|
160
158
|
- lib/musicality.rb
|
161
159
|
- lib/musicality/composition/convenience_methods.rb
|
160
|
+
- lib/musicality/composition/dsl/part_methods.rb
|
162
161
|
- lib/musicality/composition/dsl/score_dsl.rb
|
163
162
|
- lib/musicality/composition/dsl/score_methods.rb
|
164
163
|
- lib/musicality/composition/generation/counterpoint_generator.rb
|
@@ -180,6 +179,7 @@ files:
|
|
180
179
|
- lib/musicality/notation/conversion/score_converter.rb
|
181
180
|
- lib/musicality/notation/conversion/tempo_conversion.rb
|
182
181
|
- lib/musicality/notation/model/articulations.rb
|
182
|
+
- lib/musicality/notation/model/audition.rb
|
183
183
|
- lib/musicality/notation/model/change.rb
|
184
184
|
- lib/musicality/notation/model/dynamics.rb
|
185
185
|
- lib/musicality/notation/model/instrument.rb
|
@@ -278,15 +278,16 @@ files:
|
|
278
278
|
- lib/musicality/printing/lilypond/pitch_engraving.rb
|
279
279
|
- lib/musicality/printing/lilypond/score_engraver.rb
|
280
280
|
- lib/musicality/printing/lilypond/score_engraving.rb
|
281
|
+
- lib/musicality/project/auditions_task.rb
|
281
282
|
- lib/musicality/project/create_tasks.rb
|
282
283
|
- lib/musicality/project/file_cleaner.rb
|
283
284
|
- lib/musicality/project/file_raker.rb
|
284
|
-
- lib/musicality/project/load_config.rb
|
285
285
|
- lib/musicality/project/project.rb
|
286
286
|
- lib/musicality/validatable.rb
|
287
287
|
- lib/musicality/version.rb
|
288
288
|
- musicality.gemspec
|
289
289
|
- spec/composition/convenience_methods_spec.rb
|
290
|
+
- spec/composition/dsl/part_methods_spec.rb
|
290
291
|
- spec/composition/dsl/score_methods_spec.rb
|
291
292
|
- spec/composition/generation/random_rhythm_generator_spec.rb
|
292
293
|
- spec/composition/model/pitch_class_spec.rb
|
@@ -373,6 +374,7 @@ specification_version: 4
|
|
373
374
|
summary: Music notation, composition, and performance
|
374
375
|
test_files:
|
375
376
|
- spec/composition/convenience_methods_spec.rb
|
377
|
+
- spec/composition/dsl/part_methods_spec.rb
|
376
378
|
- spec/composition/dsl/score_methods_spec.rb
|
377
379
|
- spec/composition/generation/random_rhythm_generator_spec.rb
|
378
380
|
- spec/composition/model/pitch_class_spec.rb
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module Musicality
|
2
|
-
|
3
|
-
class Project
|
4
|
-
CONFIG_FILE_NAME = "config.yml"
|
5
|
-
BASE_SCORES_DIR = "scores"
|
6
|
-
|
7
|
-
DEFAULT_CONFIG = {
|
8
|
-
:scores => File.join(BASE_SCORES_DIR, "**", "*.score"),
|
9
|
-
:tempo_sample_rate => 200,
|
10
|
-
:audio_sample_rate => 44100,
|
11
|
-
:audio_sample_format => "int16"
|
12
|
-
}
|
13
|
-
|
14
|
-
SAMPLE_FORMATS = ["int8", "int16", "int24", "int32", "mulaw", "alaw", "float"]
|
15
|
-
|
16
|
-
class ConfigError < RuntimeError
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.check_config config
|
20
|
-
config.each do |k,v|
|
21
|
-
case k
|
22
|
-
when :audio_sample_format
|
23
|
-
raise ConfigError, "#{k} => #{v} is not allowed" unless SAMPLE_FORMATS.include?(v)
|
24
|
-
when :tempo_sample_rate, :audio_sample_rate
|
25
|
-
raise ConfigError, "#{k} => #{v} is not positive" unless v > 0
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.load_config project_root_dir
|
31
|
-
globabl_config_path = File.join(project_root_dir,CONFIG_FILE_NAME)
|
32
|
-
|
33
|
-
config = if File.exists? globabl_config_path
|
34
|
-
global_config = YAML.load(File.read(globabl_config_path))
|
35
|
-
DEFAULT_CONFIG.merge global_config
|
36
|
-
else
|
37
|
-
DEFAULT_CONFIG
|
38
|
-
end
|
39
|
-
|
40
|
-
# overrides from ENV
|
41
|
-
config.keys.each do |k|
|
42
|
-
k_str = k.to_s
|
43
|
-
if ENV.has_key? k_str
|
44
|
-
case k
|
45
|
-
when :tempo_sample_rate, :audio_sample_rate
|
46
|
-
config[k] = ENV[k_str].to_i
|
47
|
-
else
|
48
|
-
config[k] = ENV[k_str]
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
check_config config
|
54
|
-
return config
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|