chord-parser

Crates.iochord-parser
lib.rschord-parser
version1.1.1
sourcesrc
created_at2023-08-13 17:59:27.446347
updated_at2023-08-18 20:10:19.149303
descriptionUtilities for parsing chord signatures
homepage
repositoryhttps://github.com/RealKrazy/chord-parser/
max_upload_size
id943484
size73,345
Krazy Dev (RealKrazy)

documentation

README

Chord Parser

Parser for musical chord signatures. Successful outputs return a parsed chord with a built-in abstract representation for chords.

Features

  • Full chord parsing with additional support for unicode symbols! (i.e. Δ, °)
  • Ambiguous notation to concrete notes conversion (maj13 -> maj7 + 9 + 13, sus -> sus4, etc.)
  • Input normalization (space trimming, etc.)
  • Fully documented and convenient to use!

Usage

use chord_parser::*;

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

Advanced

For more, visit the official documentation.

Commit count: 34

cargo fmt