10 stable releases

2.2.7 Dec 24, 2024
2.2.6 Dec 23, 2024
2.0.0-alpha2 Nov 18, 2024

#330 in Audio

Download history 201/week @ 2024-11-13 47/week @ 2024-11-20 3/week @ 2024-11-27 478/week @ 2024-12-04 199/week @ 2024-12-11 570/week @ 2024-12-18 105/week @ 2024-12-25

1,352 downloads per month
Used in 2 crates

MPL-2.0 and LGPL-3.0

370KB
9K SLoC

mimium MIDI Plugin

MIDIPlugin provides 2APIs: set_midi_port("port_name") and bind_midi_note_mono(channel,default_note,default_velocity).

bind_midi_note_mono returns getter function of (float,float) value which is updated asynchronously by midi note event.

(NoteOff is treated as NoteOn with 0 velocity).

Processing for raw MIDI events like midi plugin in VST cannot be realized for now.

(Note that MIDI devices are not available for WSL. I tested only on macOS.)

let _ = set_midi_port("from Max 1")
fn osc(freq){
   ...
}
fn midi_to_hz(note){
    440.0*  (2.0 ^((note-69.0)/12.0))
}
let boundval = bind_midi_note_mono(0.0,69.0,127.0);
fn dsp(){
    let (note,vel) = boundval();

    let sig = note |> midi_to_hz |> osc 
    let r = sig * (vel /127.0);
    (r,r)
}

lib.rs:

mimium MIDI Plugin

MIDI plugin currently implements a functionality for binding midi note signal to a tuple of float value. Processing for raw MIDI events like midi plugin in VST cannot be realized for now.

Dependencies

~6–33MB
~503K SLoC