Skip to main content

Channel

Struct Channel 

Source
pub struct Channel(/* private fields */);
Expand description

A single FM channel.

This is a hardware voice. It can only be playing one note at a time.

Implementations§

Source§

impl Channel

Source

pub fn set_key_raw(&self, operator_mask: u8)

Set whether the key is down for a channel.

This version allows setting key down individually per-operator, however generally set_key alone is sufficient.

Source

pub fn set_key(&self, down: bool)

Set whether the key for a particular channel is down.

Source

pub fn set_frequency(&self, frequency: impl Into<u16>, octave: u8)

Set the frequency for a bank.

The frequency is specified in chip-specific units. Use the Note enum for pre-calculated values.

Octave can be used to increase the octave (the maximum value is 7).

Source

pub fn set_algorithm(&self, algorithm: u8, feedback: u8)

Set the algorithm and feedback for a bank.

Source

pub fn set_panning(&self, panning: Panning, ams: u8, fms: u8)

Set the panning, frequency modulation and amplituate modulation for a bank.

Source

pub fn operator(&self, operator: u8) -> Operator

Get one of this channel’s operators.

Source

pub fn operators(&self) -> impl Iterator<Item = Operator>

Get all of the operators for this channel.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.