motion-music 0.0.4 → 0.0.5

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: 3075a845df90280e037869d29a842ee6b9151d09
4
- data.tar.gz: ad00d9c53ec4548072d5f99fd34eeafa5af06d59
3
+ metadata.gz: 72ef7ca2c26436eddbd94b5d6ccc91ec0bf6242b
4
+ data.tar.gz: 88d1ea6e15640ac14252df89caf79c7b4310dcfc
5
5
  SHA512:
6
- metadata.gz: cd0799810f768db8e1fe400c37d38729365fcd5be420e30ad43966cf698c2793adf7a58e6db59c7aac8ff43669f21d389d3d3926c4dff71a2e2e01dc33148b0a
7
- data.tar.gz: f6ed0d6d1822c8f204c0b0e0c1524746aaa821ced9c1c6d0435df2b1e23d530a124d9cf9920aebdb28bcb19409bbce8f065fe6159104dc821c31a5f55fb47275
6
+ metadata.gz: 3327e53ba9376ceffbbe52dd7387e1de4a78308a4817ea48d0b43d43e37040471e724efbab42f497349224681da28beaba76f6a7493bcadb84de56a249385b23
7
+ data.tar.gz: 9c516766820a936eb443acb4072e8cd103c8761e4f147679fad22144e28a7090ec3a6d9e384bea1c7ab8b41e8a9caefc2a6d2cb65a491f7d60157587edd038f8
@@ -1,3 +1,3 @@
1
1
  module MotionMusic
2
- VERSION = "0.0.4" unless defined? MotionMusic::VERSION
2
+ VERSION = "0.0.5" unless defined? MotionMusic::VERSION
3
3
  end
data/lib/rb-music/note.rb CHANGED
@@ -58,7 +58,7 @@ module RBMusic
58
58
 
59
59
  def midi_note_number
60
60
  # see http://www.phys.unsw.edu.au/jw/notes.html
61
- 12 * Math.log2(frequency / 440) + 69
61
+ @note_number ||= (12 * Math.log2(frequency / 440) + 69).round
62
62
  end
63
63
 
64
64
  def scale(name, octaves = 1)
@@ -38,6 +38,7 @@ module RBMusic
38
38
  def <<(other)
39
39
  @notes << other
40
40
  end
41
+ alias_method :push, :<<
41
42
 
42
43
  def map(&block)
43
44
  @notes.map(&block)
@@ -48,6 +49,10 @@ module RBMusic
48
49
  end
49
50
  alias_method :eql?, :==
50
51
 
52
+ def size
53
+ @notes.size
54
+ end
55
+
51
56
  def add(that)
52
57
  NoteSet.new(@notes.map { |note| note.add(that) })
53
58
  end
@@ -1,3 +1,3 @@
1
1
  module RBMusic
2
- VERSION = "0.0.4" unless defined? RBMusic::VERSION
2
+ VERSION = "0.0.5" unless defined? RBMusic::VERSION
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-music
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Wise