Skip to content

Commit

Permalink
Bit more cleanup, apparently i can't stop tweaking it
Browse files Browse the repository at this point in the history
  • Loading branch information
beneggett committed Mar 10, 2015
1 parent bd0cdae commit 5864a29
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/music_theory/octave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class Octave
attr_accessor :starting_note, :amount, :direction, :output_file_name, :all_notes

def initialize(options = {})
@starting_note = options[:starting_note] || MusicTheory::Note.new # Note to start on
@amount= options[:amount] || 2 # Number of octaves to repeat
@direction = options[:direction] || 'asc' # Number of seconds per note
@output_file_name = options[:output_file_name] || 'octave' # File name to write (without extension)
@starting_note = options[:starting_note] || MusicTheory::Note.new # Note to start on
@amount = options[:amount] || 2 # Number of octaves to repeat
@direction = options[:direction] || 'asc' # Number of seconds per note
@output_file_name = options[:output_file_name] || 'octave' # File name to write (without extension)
build_octave
end

Expand Down
2 changes: 1 addition & 1 deletion lib/music_theory/scale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module MusicTheory
class Scale
include MusicTheory::Output
include MusicTheory::ScaleSteps
attr_accessor :starting_note, :number_of_octaves, :direction, :output_file_name, :all_notes, :scale_type, :scale_notes, :distort, :duration, :frequency
attr_accessor :starting_note, :output_file_name, :all_notes, :scale_type, :scale_notes, :distort, :duration, :frequency

def initialize(scale_type = :major, options = {})
@scale_type = scale_type
Expand Down
3 changes: 1 addition & 2 deletions lib/music_theory/scale_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def viii
private

def set_scale_step(jump)
new_chord_scale = MusicTheory::Scale.new scale_type, distort: distort, frequency: scale_notes[jump].frequency, duration: duration
new_chord_scale
MusicTheory::Scale.new scale_type, distort: distort, frequency: scale_notes[jump].frequency, duration: duration
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/music_theory/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MusicTheory
VERSION = "0.3.1"
VERSION = "0.3.2"
end
2 changes: 0 additions & 2 deletions samples/arpeggios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
scale = MusicTheory::Scale.new :major, distort: false, frequency: frequency, duration: 0.5
arpeggios = [scale.i.arpeggio, scale.iv.arpeggio, scale.v.arpeggio, scale.iv.arpeggio]
chords = [scale.i.chord, scale.iv.chord, scale.v.chord, scale.iv.chord]

harmony = MusicTheory::Harmonize.new arpeggios.map(&:samples).flatten, chords.map(&:samples).flatten


p = MusicTheory::Play.new arpeggios + [harmony] + [scale.i.chord]

0 comments on commit 5864a29

Please sign in to comment.