Module: MTK::Lang::PitchClasses

Defined in:
lib/mtk/lang/pitch_classes.rb

Overview

Defines a constant for each PitchClass in the Western chromatic scale.

Constant Summary collapse

PITCH_CLASSES =

The values of all constants defined in this module

MTK::Core::PitchClass::PITCH_CLASSES
PITCH_CLASS_NAMES =

The names of all constants defined in this module

MTK::Core::PitchClass::NAMES

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object

Lookup the value of an pitch class constant by name.

Examples:

lookup value of ā€˜Cā€™

MTK::Core::PitchClasses['C']

See Also:

  • Groups::PitchClass.[]


19
20
21
22
23
24
25
# File 'lib/mtk/lang/pitch_classes.rb', line 19

def self.[](name)
  begin
    const_get name
  rescue
    nil
  end
end