pub struct MidiToSoundBridge { /* private fields */ }Expand description
A MidiSink that interprets MIDI events into scheduled tones, managing
per-channel state, tuning, voice allocation, and timing.
Implementations§
Source§impl MidiToSoundBridge
impl MidiToSoundBridge
Sourcepub fn new(
tpq: u32,
bank: TimbreBank,
tuning: Box<dyn Tuning>,
options: BridgeOptions,
) -> Result<Self, SoundBridgeError>
pub fn new( tpq: u32, bank: TimbreBank, tuning: Box<dyn Tuning>, options: BridgeOptions, ) -> Result<Self, SoundBridgeError>
Builds a bridge with the given ticks-per-quarter, timbre bank, tuning, and options.
Sourcepub fn options(&self) -> &BridgeOptions
pub fn options(&self) -> &BridgeOptions
Returns the bridge options.
Sourcepub fn bank(&self) -> &TimbreBank
pub fn bank(&self) -> &TimbreBank
Returns the timbre bank.
Sourcepub fn voice_pool(&self) -> &VoicePool
pub fn voice_pool(&self) -> &VoicePool
Returns the underlying voice pool.
Sourcepub fn drain_tones(&mut self) -> Vec<ScheduledTone>
pub fn drain_tones(&mut self) -> Vec<ScheduledTone>
Drains all tones emitted so far, returning them and clearing the buffer.
Sourcepub fn stolen_voice_count(&self) -> usize
pub fn stolen_voice_count(&self) -> usize
Returns the number of voices stolen due to polyphony limits.
Trait Implementations§
Source§impl MidiSink for MidiToSoundBridge
impl MidiSink for MidiToSoundBridge
Auto Trait Implementations§
impl !RefUnwindSafe for MidiToSoundBridge
impl !UnwindSafe for MidiToSoundBridge
impl Freeze for MidiToSoundBridge
impl Send for MidiToSoundBridge
impl Sync for MidiToSoundBridge
impl Unpin for MidiToSoundBridge
impl UnsafeUnpin for MidiToSoundBridge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more