music_theory 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/music_theory/arpeggio.rb +25 -0
- data/lib/music_theory/scale.rb +4 -0
- data/lib/music_theory/third.rb +5 -0
- data/lib/music_theory/version.rb +1 -1
- data/lib/music_theory.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b63ead96b6711b0b9bca6a540d2546b36558405c
|
4
|
+
data.tar.gz: 4bbc82906a867e4d3fad79c73818323acbb6d553
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d692ee0612257e939f392d14715644a89af698f52d2fb58b1fb498ba7c0f6c4bc301745a2b505f82aeb1dbf1aeb7b45c8cc6e7773aab33c1a21525ebfb80c97
|
7
|
+
data.tar.gz: 0f8be28c654a07054cdf58adcc9874d2557125ab1c392a3f6945d5538e04fe2642a563a1798dd254e7ce0645413596736f241d2fe83747f6c63cd48c7ebc6211
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'music_theory/output'
|
2
|
+
|
3
|
+
module MusicTheory
|
4
|
+
class Arpeggio
|
5
|
+
include MusicTheory::Output
|
6
|
+
|
7
|
+
attr_accessor :third, :duration, :all_notes, :output_file_name
|
8
|
+
|
9
|
+
def initialize(third, options = {})
|
10
|
+
@duration = options[:duration] || 0.25
|
11
|
+
@third = third
|
12
|
+
@output_file_name = options[:output_file_name] || 'chord' # File name to write (without extension)
|
13
|
+
end
|
14
|
+
|
15
|
+
def arpeggionate
|
16
|
+
third.all_notes.each {|note| note.duration = duration}
|
17
|
+
third.all_notes + [third.all_notes[2], third.all_notes[1], third.all_notes[0], third.all_notes[1]]
|
18
|
+
end
|
19
|
+
|
20
|
+
def samples
|
21
|
+
arpeggionate.map(&:samples).flatten
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
data/lib/music_theory/scale.rb
CHANGED
data/lib/music_theory/third.rb
CHANGED
data/lib/music_theory/version.rb
CHANGED
data/lib/music_theory.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: music_theory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- README.md
|
94
94
|
- Rakefile
|
95
95
|
- lib/music_theory.rb
|
96
|
+
- lib/music_theory/arpeggio.rb
|
96
97
|
- lib/music_theory/chord.rb
|
97
98
|
- lib/music_theory/harmonize.rb
|
98
99
|
- lib/music_theory/modes.rb
|