Staff
Music theory and score rendering library with midi, notes, chords, scales, and more.
Installation
This crate currently uses the Noto Music font by default.
Usage
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
Library
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));
Features
render
: Enablerender
modulesvg
: Enable rendering to SVG
synth
: Enablesynth
module forserde
: Impl Deserialize and Serialize for many crate types