class Mystic::Util

Overview

Miscellaneous utility methods

Defined in:

mystic/util.cr

Constant Summary

ACCIDENTAL_OFFSETS = {"#": 1, x: 2, b: -1, "♯": 1, "♭": -1, "𝄫": -2, "𝄪": 2}
PERFECT_INTERVALS = [1, 4, 5, 8]

Class Method Summary

Class Method Detail

def self.accidental_offset(accidental : String) : Int32 #

Return the number of alterations given an accidental


[View source]
def self.normalize_accidental(accidental_offset : Int32) : String #

Return the proper accidental given a numerical accidental_offset


[View source]
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


[View source]
def self.perfect?(number : Int32) : Bool #

Return if given number is a perfect interval


[View source]