pub struct VoiceChannel { /* private fields */ }
Expand description
Represents a single MIDI channel within XSynth.
Keeps track and manages MIDI events and the active voices of a channel.
MIDI CC Support Chart:
CC0
: Bank SelectCC6
,CC38
,CC100
,CC101
: RPN & NRPNCC7
: VolumeCC8
: BalanceCC10
: PanCC11
: ExpressionCC64
: Damper pedalCC71
: Cutoff resonanceCC72
: Release time multiplierCC73
: Attack time multiplierCC74
: Cutoff frequencyCC120
: All sounds offCC121
: Reset all controllersCC123
: All notes off
Implementations§
Source§impl VoiceChannel
impl VoiceChannel
Sourcepub fn new(
options: ChannelInitOptions,
stream_params: AudioStreamParams,
threadpool: Option<Arc<ThreadPool>>,
) -> VoiceChannel
pub fn new( options: ChannelInitOptions, stream_params: AudioStreamParams, threadpool: Option<Arc<ThreadPool>>, ) -> VoiceChannel
Initializes a new voice channel.
options
: Channel configurationstream_params
: Parameters of the output audiothreadpool
: The thread-pool that will be used to render the individual keys’ voices concurrently. If None is used, the voices will be rendered on the same thread.
Sourcepub fn process_control_event(&mut self, event: ControlEvent)
pub fn process_control_event(&mut self, event: ControlEvent)
Sends a ControlEvent to the channel.
See the ControlEvent
documentation for more information.
Sourcepub fn process_event(&mut self, event: ChannelEvent)
pub fn process_event(&mut self, event: ChannelEvent)
Sends a ChannelEvent to the channel.
See the ChannelEvent
documentation for more information.
Sourcepub fn push_events_iter<T: Iterator<Item = ChannelEvent>>(&mut self, iter: T)
pub fn push_events_iter<T: Iterator<Item = ChannelEvent>>(&mut self, iter: T)
Sends multiple ChannelEvent items to the channel as an iterator.
Sourcepub fn get_channel_stats(&self) -> VoiceChannelStatsReader
pub fn get_channel_stats(&self) -> VoiceChannelStatsReader
Returns a reader for the VoiceChannel statistics.
See the VoiceChannelStatsReader
documentation for more information.
Trait Implementations§
Source§impl AudioPipe for VoiceChannel
impl AudioPipe for VoiceChannel
Source§fn stream_params(&self) -> &AudioStreamParams
fn stream_params(&self) -> &AudioStreamParams
The audio stream parameters of the audio pipe.
Source§fn read_samples_unchecked(&mut self, out: &mut [f32])
fn read_samples_unchecked(&mut self, out: &mut [f32])
Reads samples from the pipe without checking the channel count of the output.
Source§fn read_samples(&mut self, to: &mut [f32])
fn read_samples(&mut self, to: &mut [f32])
Reads samples from the pipe. Read more
Auto Trait Implementations§
impl Freeze for VoiceChannel
impl !RefUnwindSafe for VoiceChannel
impl Send for VoiceChannel
impl Sync for VoiceChannel
impl Unpin for VoiceChannel
impl !UnwindSafe for VoiceChannel
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more