midia 0.1.1

A simple wrapper for writing the midi file easier.
Documentation
  • Coverage
  • 0%
    0 out of 194 items documented0 out of 28 items with examples
  • Size
  • Source code size: 16.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • levinion/midia
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • levinion

MIDIA

A simple wrapper for writing the midi file easier.

Usage

fn main() {
    let mut writer = MidiWriter::new(TrackType::Single, 1, 120);
    let mut track = MidiTrack::new();
    track
        .set_bpm(120)
        .set_tonality(Tonality::G)
        .change_instrument(InstrumentType::AcousticGrandPiano)
        .note(0.5, Pitch::A4, 90)
        .note(0.5, Pitch::B4, 90)
        .note(2., Pitch::C5, 90)
        .note(0.5, Pitch::B4, 90)
    // ...
        .note(1., Pitch::F5, 90)
        .note(1., Pitch::E5, 90)
        .note(1., Pitch::D5, 90)
        .note(1., Pitch::C5, 90)
        .repeat(5);
    writer.add_track(track);
    writer.write("...");
}