Skip to content

Commit

Permalink
show proliferation of tunings inside guitar class
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-j-m committed Sep 7, 2022
1 parent 0d16dfd commit a9ada34
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions lib/blues/guitar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,26 @@ def pick(string:, fret:)
end

def tune(tuning = :standard)
raise "unknown tuning" unless VALID_TUNINGS.include?(tuning)
@tuning = tuning

send("#{@tuning}_tuning")
case tuning
when :standard
standard_tuning
when :down_half_step
down_half_step_tuning
when :drop_d
drop_d_tuning
when :open_a
open_a_tuning
when :modal_c
modal_c_tuning
when :all_fourths
all_fourths_tuning
when :all_fifths
all_fifths_tuning
else
raise "unknown tuning"
end

@tuning
@tuning = tuning
end

def restring(gauge_set:)
Expand Down Expand Up @@ -62,5 +76,11 @@ def down_half_step_tuning
@strings[1].tune(note: :b_flat, octave: 3)
@strings[0].tune(note: :e_flat, octave: 4)
end

def drop_d_tuning = nil
def open_a_tuning = nil
def modal_c_tuning = nil
def all_fourths_tuning = nil
def all_fifths_tuning = nil
end
end

0 comments on commit a9ada34

Please sign in to comment.