#music #midi

mumuse

Small music theory library written in Rust with MIDI capabilities

7 releases (breaking)

Uses new Rust 2021

0.7.0 Feb 6, 2022
0.6.0 Feb 3, 2022
0.5.0 Jan 16, 2022
0.4.0 Jan 15, 2022
0.1.0 Jan 8, 2022

#129 in Audio

Download history 20/week @ 2022-01-28 22/week @ 2022-02-04 7/week @ 2022-02-11 7/week @ 2022-02-18 23/week @ 2022-03-11 28/week @ 2022-03-18 10/week @ 2022-04-08 1/week @ 2022-04-15 9/week @ 2022-04-22 44/week @ 2022-04-29 44/week @ 2022-05-06 122/week @ 2022-05-13

219 downloads per month

GPL-3.0-only

1MB
1K SLoC

mumuse

build license doc.rs crates.io rustc

A Rust small music theory library, featuring:

  • Elementary operations with notes and chords
  • Building chords from scales degrees
  • Scale modes
  • Sequence building with streams
  • Midi real time playing of streams

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

How to use

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.

Dependencies

~4–11MB
~191K SLoC