pub struct MidiVSTConverter { /* private fields */ }
Expand description
This is an unsafe converter from MIDI events received from midir
into the rust-vst
VST api.
It’s unsafe because it must do manual memory allocation & management to interface with the VST C-style API.
Pre-allocates buffers of MIDI events up-front. Capacity is set to 100 MIDI messages by default.
More than 100 midi messages being passed into it in a single buffer tick will result in dropped messages.
The collecting phase of the audio-thread should collect at most a limit of messages.
Threshold can be changed in the future to include more.
Implementations§
source§impl MidiVSTConverter
impl MidiVSTConverter
sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Create a new MidiVSTConverter with capacity.
Will pre-allocate buffers.
sourcepub fn accept(&mut self, midi_message_buffer: &[MidiMessageEntry]) -> &Events
pub fn accept(&mut self, midi_message_buffer: &[MidiMessageEntry]) -> &Events
Pushes MIDI messages onto a pre-allocated Events
struct. Returns a reference to it.
This should be real-time safe.
The vst::api::Events
returned may be passed into a VST plugin instance.