Class: Fretboard::Tunings

Inherits:
Object
  • Object
show all
Defined in:
lib/fretboard/tunings.rb

Constant Summary collapse

TUNINGS =

Fretboard::Tunings.get(:standart) Fretboard::Tunings.exists?(:standart)

{
  STANDART: {
    STRINGS: {
      1 => {
        NOTE: 'E'
      },
      2 => {
        NOTE: 'B'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'E'
      }
    }
  },

  DROP_C: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'A'
      },
      3 => {
        NOTE: 'F'
      },
      4 => {
        NOTE: 'C'
      },
      5 => {
        NOTE: 'G'
      },
      6 => {
        NOTE: 'C'
      }
    }
  },

  DROP_D: {
    STRINGS: {
      1 => {
        NOTE: 'E'
      },
      2 => {
        NOTE: 'B'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  DOUBLE_DROP_D: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'B'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  OPEN_A: {
    STRINGS: {
      1 => {
        NOTE: 'E'
      },
      2 => {
        NOTE: 'A'
      },
      3 => {
        NOTE: 'E'
      },
      4 => {
        NOTE: [
          'C#',
          'Db'
        ]
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'E'
      }
    }
  },

  OPEN_C: {
    STRINGS: {
      1 => {
        NOTE: 'E'
      },
      2 => {
        NOTE: 'C'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'C'
      },
      5 => {
        NOTE: 'G'
      },
      6 => {
        NOTE: 'C'
      }
    }
  },

  OPEN_D: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'A'
      },
      3 => {
        NOTE: [
          'F#',
          'Gb'
        ]
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  OPEN_D_MINOR: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'A'
      },
      3 => {
        NOTE: 'F'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  OPEN_G: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'B'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'G'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  OPEN_G_MINOR: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: [
          'A#',
          'Bb'
        ]
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'G'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  MODAL_D: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'A'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'A'
      },
      6 => {
        NOTE: 'D'
      }
    }
  },

  MODAL_G: {
    STRINGS: {
      1 => {
        NOTE: 'D'
      },
      2 => {
        NOTE: 'C'
      },
      3 => {
        NOTE: 'G'
      },
      4 => {
        NOTE: 'D'
      },
      5 => {
        NOTE: 'G'
      },
      6 => {
        NOTE: 'D'
      }
    }
  }
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tuning_name) ⇒ Tunings

Returns a new instance of Tunings.



301
302
303
# File 'lib/fretboard/tunings.rb', line 301

def initialize(tuning_name)
  @tuning_name = tuning_name.upcase.to_sym
end

Class Method Details

.exists?(tuning_name) ⇒ Boolean

Returns:

  • (Boolean)


297
298
299
# File 'lib/fretboard/tunings.rb', line 297

def self.exists?(tuning_name)
  new(tuning_name).exists?
end

.get(tuning_name) ⇒ Object



293
294
295
# File 'lib/fretboard/tunings.rb', line 293

def self.get(tuning_name)
  new(tuning_name).get
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


309
310
311
# File 'lib/fretboard/tunings.rb', line 309

def exists?
  TUNINGS.key?(@tuning_name)
end

#getObject



305
306
307
# File 'lib/fretboard/tunings.rb', line 305

def get
  TUNINGS[@tuning_name]
end