Crates.io | mumuse |
lib.rs | mumuse |
version | 0.7.0 |
source | src |
created_at | 2022-01-08 16:35:48.906264 |
updated_at | 2022-02-06 13:01:15.076597 |
description | Small music theory library written in Rust with MIDI capabilities. |
homepage | |
repository | https://github.com/alelouis/mumuse/ |
max_upload_size | |
id | 510342 |
size | 1,005,853 |
A Rust small music theory library, featuring:
This is still in active development, things will brake.
let mut stream: Stream = Stream::new();
let mut conn_out = midi::get_output_connection("Virtual Midi Bus 1".to_string());
// Constructing event stream
let notes = ["A3", "B3", "C4", "D4", "A3", "B3", "C4", "D4"];
let mut time = Time::new(1, 4, 1);
let duration = Duration::new(16, 1); // 16th notes
for n in notes {
let note = Note::try_from(n).unwrap();
stream.add_note(note, time, duration);
time = time + duration;
}
// Real time play of events
stream.play(&mut conn_out, 120.0, 4); // midi_connection, beat per minute, beats per bar
Add mumuse lib crate to your Cargo.toml
file.
mumuse = "version"
Browse the examples/
folder in order to see capabilities of the library.
Also, you can check the documentation.