head_music 0.11.7 → 0.11.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1713118820be09fdaae422ca3f3a834cd20cdddf
4
- data.tar.gz: a5460c25999d6fb9a3d22d09b69da5292f69c194
3
+ metadata.gz: 6be1575228b7a6ea778c74be5e1f0422732fa7e0
4
+ data.tar.gz: 5761e7ae91487307331c9f73487d6b91a1fdd8d9
5
5
  SHA512:
6
- metadata.gz: 8cf2b8741f89478a8dc68f7d54067b4ead79bbbf8f64244c2247cf4ea6ac0a9c5138e9ce6bc95423178cbe6c602d36179d5b4fe1fde85fb2743b3de508e2d1b9
7
- data.tar.gz: b0ad53ccfea420a37a4729d1d265bb0a8cd0a13ab33ba58604d6079470c9a93db75a71bd26c8cd797274cc8ca9c11ede7b8caba38d3f55c4fde539e9ff856085
6
+ metadata.gz: b754a036d18c02225ed9bef0e9a778f870adf265a39df3d612dbc67544631496883fe2cda40c5088bfaac58fe46df309e38e43037eb43c4b96258650ca82d49e
7
+ data.tar.gz: 4e7bb9461fbf78a833773d1cabcbbe0574e48087fde520f4f181aeafdb4ade491adcc463b79c2b384e50e437bf3e31a50d3ea2885314dea845e75f130075c843
@@ -3,7 +3,7 @@ class HeadMusic::Chord
3
3
 
4
4
  def initialize(pitches)
5
5
  raise ArgumentError if pitches.length < 3
6
- @pitches = pitches.map { |pitch| Pitch.get(pitch) }.sort
6
+ @pitches = pitches.map { |pitch| HeadMusic::Pitch.get(pitch) }.sort
7
7
  end
8
8
 
9
9
  def consonant_triad?
@@ -22,6 +22,18 @@ class HeadMusic::Style::Annotation
22
22
  [marks].flatten.compact.map(&:fitness).reduce(1, :*)
23
23
  end
24
24
 
25
+ def perfect?
26
+ fitness == 1
27
+ end
28
+
29
+ def start_position
30
+ [marks].flatten.compact.map(&:start_position).sort.first
31
+ end
32
+
33
+ def end_position
34
+ [marks].flatten.compact.map(&:end_position).sort.last
35
+ end
36
+
25
37
  def marks
26
38
  raise NotImplementedError
27
39
  end
@@ -1,3 +1,3 @@
1
1
  module HeadMusic
2
- VERSION = "0.11.7"
2
+ VERSION = "0.11.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: head_music
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.7
4
+ version: 0.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Head
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-11 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport