music_theory 0.1.0 → 0.1.1
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.rb +1 -0
- data/lib/music_theory/scale.rb +3 -0
- data/lib/music_theory/scale_steps.rb +44 -0
- data/lib/music_theory/version.rb +1 -1
- 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: d3c00902c9f5e41c431cbff53ee81bc518fcb32e
|
4
|
+
data.tar.gz: ed04152234b50e11e169f55721d2f78af92bf141
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e363c3fdc8f3dcd033639164cfa0efbb2f5ee2754e783450cafee6559c43c44f760161ec8b4fe08d5019ef9ece27af8c64d18a6b309f9aa596331dd45b1bf74
|
7
|
+
data.tar.gz: 3523354f9bf79915aa4b2c64b9f7dd71702efbb75018a6373574362cd638caef98d0e4ba709b05b74ba66975ff335c03e87b0f1766515c00a2a2907bc2de6e63
|
data/lib/music_theory.rb
CHANGED
data/lib/music_theory/scale.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require 'music_theory/output'
|
2
|
+
require 'music_theory/scale_steps'
|
2
3
|
|
3
4
|
module MusicTheory
|
4
5
|
class Scale
|
5
6
|
include MusicTheory::Output
|
7
|
+
include MusicTheory::ScaleSteps
|
6
8
|
attr_accessor :starting_note, :number_of_octaves, :direction, :output_file_name, :all_notes, :scale_type, :scale_notes, :distort, :duration, :frequency
|
7
9
|
|
8
10
|
def initialize(scale_type = :major, options = {})
|
@@ -56,6 +58,7 @@ module MusicTheory
|
|
56
58
|
def chord
|
57
59
|
third.chord
|
58
60
|
end
|
61
|
+
|
59
62
|
end
|
60
63
|
|
61
64
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module MusicTheory
|
2
|
+
module ScaleSteps # Concern for Scale
|
3
|
+
|
4
|
+
def i
|
5
|
+
self
|
6
|
+
end
|
7
|
+
|
8
|
+
def ii
|
9
|
+
set_scale_step(1)
|
10
|
+
end
|
11
|
+
|
12
|
+
def iii
|
13
|
+
set_scale_step(2)
|
14
|
+
end
|
15
|
+
|
16
|
+
def iv
|
17
|
+
set_scale_step(3)
|
18
|
+
end
|
19
|
+
|
20
|
+
def v
|
21
|
+
set_scale_step(4)
|
22
|
+
end
|
23
|
+
|
24
|
+
def vi
|
25
|
+
set_scale_step(5)
|
26
|
+
end
|
27
|
+
|
28
|
+
def vii
|
29
|
+
set_scale_step(6)
|
30
|
+
end
|
31
|
+
|
32
|
+
def viii
|
33
|
+
set_scale_step(7)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def set_scale_step(jump)
|
39
|
+
new_chord_scale = MusicTheory::Scale.new scale_type, distort: distort, frequency: scale_notes[jump].frequency, duration: duration
|
40
|
+
new_chord_scale
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
data/lib/music_theory/version.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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Eggett
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/music_theory/output.rb
|
102
102
|
- lib/music_theory/play.rb
|
103
103
|
- lib/music_theory/scale.rb
|
104
|
+
- lib/music_theory/scale_steps.rb
|
104
105
|
- lib/music_theory/third.rb
|
105
106
|
- lib/music_theory/transpose.rb
|
106
107
|
- lib/music_theory/version.rb
|