Method: Coltrane::Representation::Guitar#initialize

Defined in:
lib/coltrane/representation/guitar.rb

#initialize(tuning: nil, frets: nil, special_frets: nil) ⇒ Guitar

Returns a new instance of Guitar.



29
30
31
32
33
34
35
36
37
# File 'lib/coltrane/representation/guitar.rb', line 29

def initialize(tuning: nil, frets: nil, special_frets: nil)
  @tuning        = tuning        || %w[E2 A2 D3 G3 B3 E4]
  @special_frets = special_frets || [3, 5, 7, 9, 12, 15, 17, 19]
  @frets         = frets         || 23

  @strings = @tuning.map do |p|
    String.new(Theory::Pitch[p], guitar: self)
  end
end