Crate chord_parser

Source
Expand description

This cargo provides a parser for musical chord signatures. Successful outputs return a parsed chord using a built-in representation.

§Simple Example

use chord_parser::*;
 
let mut parser = ChordParser::new();
 
let result = parser.parse("Cmaj9");
 
match result {
    ChordParseResult::Success(chord) => println!("{:?}", chord.alterations.seventh),
    ChordParseResult::Failure(kind) => panic!("Expected successful parse!"),
};
 
let result = parser.parse("E7(b9,b13)");
 
// Do something else...

§Advanced

For everything you can do with parsing, visit ChordParser.

To examine the abstract representation of chord elements, visit chord.

Modules§

chord
Abstract representations for elements of a chord signature.
utils
Utilities for parsing required by the crate.

Structs§

ChordParser
The chord parser used for parsing chord signatures into abstract representations defined in chord module

Enums§

ChordParseErrorKind
The type of error returned by ChordParser parsing failure
ChordParseResult
Result of the ChordParser’s parse.