Crates.io | chordpro |
lib.rs | chordpro |
version | 0.3.1 |
source | src |
created_at | 2019-12-31 19:07:41.590864 |
updated_at | 2021-11-09 10:09:18.650695 |
description | A Chordpro parser for Rust |
homepage | |
repository | https://github.com/joseluiscd/chordpro-rs |
max_upload_size | |
id | 193926 |
size | 30,526 |
Chordpro file parser written in Rust. Chordpro is a simple text format for the notation of lyrics with chords. Although initially intended for guitarists, it can be used for all kinds of musical purposes.
Specification of the format can be found in the official website: https://www.chordpro.org/
The std::str::FromStr
is implemented for the Song
struct:
# use chordpro::Song;
# use std::str::FromStr;
let song = Song::from_str(r##"
{title: Song Title}"
{artist: The Artist}
This is the first verse.
You can specify chords using brackets.
This is a [G]chord
{soc}
This is the chorus of the song
[Em]You can also add some chords
{eoc}
"##).unwrap();
x_
)At the moment, only A-G notation is supported for parsing. Flats (with b
),
sharps (with #
) and common postfixes (m
, min
, maj
, numbers).
Wrapping a reference to the chord in a chordpro::Latin
formats that chord with
latin notation (Do
, Re
, Mi
).