class Mystic::ChordParser
- Mystic::ChordParser
- Reference
- Object
Overview
Parser for chord symbols
Defined in:
mystic/chord_parser.crConstant 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
-
.normalize_basic_quality(s : String) : String
Return a standardized format for qualities for a given string quality
-
.parse(s : String) : Chord
Parse a string chord symbol and return the resulting
Chord
-
.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)
-
.tokenize_extensions(s : String) : Array(Token)
Splits the given string into tokens
Class Method Detail
def self.normalize_basic_quality(s : String) : String
#
Return a standardized format for qualities for a given string quality
Parse a string chord symbol and return the resulting Chord
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
Splits the given string into tokens