Skip to content

Parsing strings to chords #22

Answered by henryksloan
mainrs asked this question in General
Aug 22, 2020 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hi! The library provides from_regex functions for most domains, including chords and scales. The general form of the regex is <root> <quality> <number>, where quality and number are optional. That means that C# will work as you indicate. To get D# major 7, you would have to pass D# major seventh or D# maj seventh, as the number must be fully spelled out (though number and quality are case insensitive, and number can be omitted). C# minor can be retrieved by passing C# minor or C# min.

It wouldn't be a huge modification to allow abbreviations. In fact, the regex parses are already case insensitive, and effectively ignore whitespace. One would just have to extend the regexes in number.rs and

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mainrs
Comment options

@henryksloan
Comment options

@ozankasikci
Comment options

@XBagon
Comment options

Answer selected by mainrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants