class Mystic::ChordParser

Overview

Parser for chord symbols

Defined in:

mystic/chord_parser.cr

Constant Summary

ACCIDENTAL_ALIASES = {"+": "#", "-": "b"}
DEFAULT_ACCIDENTALS = {"2": "#", "6": "#", "7": "b", "9": "#", "13": "#", "14": "b"}

Default accidentals for imperfect intervals

IMPLIED_MEMBERS = {"9": [7], "11": [7, 9], "13": [7, 9, 11]}

Class Method Summary

Class Method Detail

def self.normalize_basic_quality(s : String) : String #

Return a standardized format for qualities for a given string quality


[View source]
def self.parse(s : String) : Chord #

Parse a string chord symbol and return the resulting Chord


[View source]
def self.parse_extensions(tokens : Array(Token), has_seventh = false) : Array(Interval) #

Uses the given tokens and returns a list of extended intervals (beyond the 3rd/5th)

When has_seventh is true, the chord symbol has an explicit 7th, so there is no need to add an implied 7th


[View source]
def self.tokenize_extensions(s : String) : Array(Token) #

Splits the given string into tokens


[View source]