module MTK::Lang::Intervals
Defines a constant for {Core::Interval}s up to an octave using diatonic naming conventions
Naming conventions
P#: perfect interval M#: major interval m#: minor interval TT: tritone a#: augmented interval d#: diminished interval
These can be thought of like constants, but in order to support the lower case names, it was necessary to define them as “pseudo constant” methods. Like constants, these methods are available either through the module (MTK::Lang::Intervals::m2) or via mixin (include MTK::Lang::Intervals
; m2). They are listed under the “Instance Attribute Summary” of this page.
@see Core::Interval
@see en.wikipedia.org/wiki/Interval_(music)#Main_intervals
Constants
- INTERVALS
All “psuedo constants” defined in this module
- INTERVAL_NAMES
The names of all “psuedo constants” defined in this module @see MTK::Core::Interval::NAMES_BY_VALUE
Public Class Methods
define_interval(name, value, description, semitones)
click to toggle source
@private @!macro [attach] define_interval
$3: $4 semitones @!attribute [r] @return [MTK::Core::Interval] interval of $4 semitones
# File lib/mtk/lang/intervals.rb, line 29 def self.define_interval name, value, description, semitones define_constant name, value end