Class: Jamming::Dictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/jamming/dictionary.rb

Constant Summary collapse

DICTIONARY =
{
  "A"  => %w(x02220),
  "Am" => %w(x02210),
  "B"  => %w(x24442),
  "Bm" => %w(x24432),
  "C"  => %w(x32010),
  "Cm" => %w(x35543),
  "D"  => %w(xx0232),
  "Dm" => %w(xx0231),
  "E"  => %w(022100),      
  "Em" => %w(022000),
  "F"  => %w(133211),
  "Fm" => %w(133111),
  "G"  => %w(320022 320002),
  "Gm" => %w(355333)      
}

Class Method Summary collapse

Class Method Details

.name_for(frets) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/jamming/dictionary.rb', line 20

def self.name_for(frets)
  frets = normalize_frets(frets)
  DICTIONARY.each do |key, different_fingerings|
    return key if different_fingerings.include?(frets)
  end
  nil
end