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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00ba460c39f1666763146ade0d33e4d99db9c925
4
- data.tar.gz: ceaf0e9f7bedb00e62cb97cdfa8957f5d52e7327
3
+ metadata.gz: d3c00902c9f5e41c431cbff53ee81bc518fcb32e
4
+ data.tar.gz: ed04152234b50e11e169f55721d2f78af92bf141
5
5
  SHA512:
6
- metadata.gz: 70b088280057088c6cdc6967d4ee73412f7f5f9a884ef4e8e52226774de354c6aa42ad64cad00e3046b0385b0154a75ff25c0aaa156fc4993a3262cba697d4d6
7
- data.tar.gz: 81f5c99a4d3c7147f90579a1b8608cb264c05a3659487d479b000c0cd7bb56a4c512ddbe899a32b712414c5a5a909821ff27dc359d46cd7dc0736f1bee5d95dc
6
+ metadata.gz: 3e363c3fdc8f3dcd033639164cfa0efbb2f5ee2754e783450cafee6559c43c44f760161ec8b4fe08d5019ef9ece27af8c64d18a6b309f9aa596331dd45b1bf74
7
+ data.tar.gz: 3523354f9bf79915aa4b2c64b9f7dd71702efbb75018a6373574362cd638caef98d0e4ba709b05b74ba66975ff335c03e87b0f1766515c00a2a2907bc2de6e63
data/lib/music_theory.rb CHANGED
@@ -5,6 +5,7 @@ require "music_theory/version"
5
5
  require "music_theory/note"
6
6
  require "music_theory/octave"
7
7
  require "music_theory/scale"
8
+ require "music_theory/scale_steps"
8
9
  require "music_theory/modes"
9
10
  require "music_theory/third"
10
11
  require "music_theory/chord"
@@ -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
@@ -1,3 +1,3 @@
1
1
  module MusicTheory
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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