This is a fork of staff.rs to hard code a path to NotoMusic (included at build time), so we don't have to use font-kit, which doesn't build on the wasm target.
Music theory and score rendering library with midi, notes, chords, scales, and more.
This crate currently uses the Noto Music font by default.
cargo install staff
example.ly
\clef treble
a'1
d'2. e'4
f'2 e'4 f'
b'2. a'4
g'2 fis'4 g'
$ staff example.ly > example.svg
use staff::{midi, Chord, Pitch};
let chord = Chord::from_midi(
midi!(C, 4),
[midi!(E, 3), midi!(G, 3), midi!(C, 4)]
);
assert_eq!(chord.to_string(), "C/E");
let pitches = [Pitch::E, Pitch::G, Pitch::C];
assert!(chord.into_iter().eq(pitches));