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

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

Structs

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

Enums