musicality 0.6.1 → 0.7.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 +3 -0
- data/lib/musicality/notation/model/score.rb +17 -1
- data/lib/musicality/version.rb +1 -1
- data/spec/notation/packing/score_packing_spec.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2138ce48e8476b381ac46a6bdc6c9b5578de656
|
4
|
+
data.tar.gz: f95722c9c8a4818701880bbe733ccc7684ee41ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9787df99b773046c025138212a9b67494e6ef080211ef429ae04519900e7f3e51dd68c5f0bccb68e762c918e77362fee23a9effb6df8dd06876674914e6d727c
|
7
|
+
data.tar.gz: 965abe4f0fd8e897f99909a4d8a6b8c1967f2e45cb8291357d11e60d7c7666660ac9b4f11c5c21f2653de16bb1f74e0e307156183d42ece31d871802d1d07f64
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
### 0.7.0 / 2015-04-28
|
2
|
+
* Replace Score's title and composer accessors with dual-methods Score#title and Score#composer that can be used to get/set. This makes them useful in the DSL context.
|
3
|
+
|
1
4
|
### 0.6.0 / 2015-04-28
|
2
5
|
* Add Score DSL
|
3
6
|
* Add composition convenience methods `e`, `q`, and `dq` for generating eighth, quarter, and dotted quarter notes
|
@@ -2,7 +2,23 @@ module Musicality
|
|
2
2
|
|
3
3
|
class Score
|
4
4
|
include Validatable
|
5
|
-
attr_accessor :parts, :program
|
5
|
+
attr_accessor :parts, :program
|
6
|
+
|
7
|
+
def title value = nil
|
8
|
+
if value.nil?
|
9
|
+
return @title
|
10
|
+
else
|
11
|
+
@title = value
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def composer value = nil
|
16
|
+
if value.nil?
|
17
|
+
return @composer
|
18
|
+
else
|
19
|
+
@composer = value
|
20
|
+
end
|
21
|
+
end
|
6
22
|
|
7
23
|
def initialize parts: {}, program: [], title: nil, composer: nil, sections: {}
|
8
24
|
@parts = parts
|
data/lib/musicality/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
|
3
3
|
measured_score = Score::Measured.new(FOUR_FOUR,120) do |s|
|
4
|
-
s.title
|
5
|
-
s.composer
|
4
|
+
s.title "The best song ever"
|
5
|
+
s.composer "James T."
|
6
6
|
|
7
7
|
s.meter_changes[1] = Change::Immediate.new(THREE_FOUR)
|
8
8
|
s.meter_changes[7] = Change::Immediate.new(SIX_EIGHT)
|
@@ -31,15 +31,15 @@ end
|
|
31
31
|
unmeasured_score = Score::Unmeasured.new(30) do |s|
|
32
32
|
s.program = measured_score.program
|
33
33
|
s.parts = measured_score.parts
|
34
|
-
s.title
|
35
|
-
s.composer
|
34
|
+
s.title measured_score.title
|
35
|
+
s.composer measured_score.composer
|
36
36
|
end
|
37
37
|
|
38
38
|
timed_score = Score::Timed.new do |s|
|
39
39
|
s.program = measured_score.program
|
40
40
|
s.parts = measured_score.parts
|
41
|
-
s.title
|
42
|
-
s.composer
|
41
|
+
s.title measured_score.title
|
42
|
+
s.composer measured_score.composer
|
43
43
|
end
|
44
44
|
|
45
45
|
[ measured_score, unmeasured_score, timed_score ].each do |score|
|