class Mystic::Util
- Mystic::Util
- Reference
- Object
Overview
Miscellaneous utility methods
Defined in:
mystic/util.crConstant Summary
-
ACCIDENTAL_OFFSETS =
{"#": 1, x: 2, b: -1, "♯": 1, "♭": -1, "𝄫": -2, "𝄪": 2}
-
PERFECT_INTERVALS =
[1, 4, 5, 8]
Class Method Summary
-
.accidental_offset(accidental : String) : Int32
Return the number of alterations given an accidental
-
.normalize_accidental(accidental_offset : Int32) : String
Return the proper accidental given a numerical accidental_offset
-
.offset_to_quality(offset : Int32, is_perfect : Bool) : String
Return a quality corresponding to the offset (number of alterations) and whether it is_perfect
-
.perfect?(number : Int32) : Bool
Return if given number is a perfect interval
Class Method Detail
def self.accidental_offset(accidental : String) : Int32
#
Return the number of alterations given an accidental
def self.normalize_accidental(accidental_offset : Int32) : String
#
Return the proper accidental given a numerical accidental_offset
def self.offset_to_quality(offset : Int32, is_perfect : Bool) : String
#
Return a quality corresponding to the offset (number of alterations) and whether it is_perfect