[go: nahoru, domu]

Skip to content
forked from staff-rs/staff

Music theory CLI and library with midi, notes, chords, scales, and more (test branch)

License

Notifications You must be signed in to change notification settings

rachtsingh/staff

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes

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.

Staff

crate documentation

Music theory and score rendering library with midi, notes, chords, scales, and more.

staff

Installation

This crate currently uses the Noto Music font by default.

cargo install staff

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));

About

Music theory CLI and library with midi, notes, chords, scales, and more (test branch)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.9%
  • Other 0.1%