Struct VoiceChannel

Source
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 Select
  • CC6, CC38, CC100, CC101: RPN & NRPN
  • CC7: Volume
  • CC8: Balance
  • CC10: Pan
  • CC11: Expression
  • CC64: Damper pedal
  • CC71: Cutoff resonance
  • CC72: Release time multiplier
  • CC73: Attack time multiplier
  • CC74: Cutoff frequency
  • CC120: All sounds off
  • CC121: Reset all controllers
  • CC123: All notes off

Implementations§

Source§

impl VoiceChannel

Source

pub fn new( options: ChannelInitOptions, stream_params: AudioStreamParams, threadpool: Option<Arc<ThreadPool>>, ) -> VoiceChannel

Initializes a new voice channel.

  • options: Channel configuration
  • stream_params: Parameters of the output audio
  • threadpool: 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.
Source

pub fn process_control_event(&mut self, event: ControlEvent)

Sends a ControlEvent to the channel. See the ControlEvent documentation for more information.

Source

pub fn process_event(&mut self, event: ChannelEvent)

Sends a ChannelEvent to the channel. See the ChannelEvent documentation for more information.

Source

pub fn push_events_iter<T: Iterator<Item = ChannelEvent>>(&mut self, iter: T)

Sends multiple ChannelEvent items to the channel as an iterator.

Source

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

Source§

fn stream_params(&self) -> &AudioStreamParams

The audio stream parameters of the audio pipe.
Source§

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])

Reads samples from the pipe. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.