Skip to main content

StmChannel

Struct StmChannel 

Source
pub struct StmChannel {
Show 23 fields pub instrument: u8, pub note: (u8, u8), pub volume: u8, pub voice: MixerVoice, pub effect: u8, pub effect_param: u8, pub cur_semis: f32, pub porta_target_semis: f32, pub porta_speed: u8, pub porta_updown_mem: u8, pub vib_pos: u8, pub vib_speed: u8, pub vib_depth: u8, pub vol_slide_mem: u8, pub trem_pos: u8, pub trem_speed: u8, pub trem_depth: u8, pub note_cut_tick: u8, pub note_delay_tick: u8, pub pending_note: (u8, u8), pub pending_instrument: u8, pub pending_volume: u8, pub has_pending_delay: bool,
}
Expand description

Per-channel playback state for STM.

Fields§

§instrument: u8

Currently-loaded instrument index (1..=31, 0 = none).

§note: (u8, u8)

Current note (octave, semitone) for the currently playing sample.

§volume: u8

Volume 0..=64.

§voice: MixerVoice

Shared mixer voice.

§effect: u8

Current effect command 0..=0xF.

§effect_param: u8

Current effect parameter.

§cur_semis: f32

Current live semitone index (fractional, measured from C-0). Porta / vibrato / fine porta all mutate this; the voice frequency is derived from it every tick.

§porta_target_semis: f32

Target semitone index for tone portamento (3xy / 5xy).

§porta_speed: u8

Tone-porta speed memory (shared between 3xy and 5xy).

§porta_updown_mem: u8

1xy / 2xy memory — last non-zero parameter (shared).

§vib_pos: u8

Vibrato sine-table position 0..=63.

§vib_speed: u8

Vibrato speed memory (last non-zero 4xy x nibble).

§vib_depth: u8

Vibrato depth memory (last non-zero 4xy y nibble).

§vol_slide_mem: u8

Axy volume-slide parameter memory (shared with 5xy / 6xy).

§trem_pos: u8

Tremolo sine-table position 0..=63. Walks like vib_pos but on a separate register so 4xy vibrato and 7xy tremolo on the same channel don’t share phase.

§trem_speed: u8

Tremolo speed memory (last non-zero 7xy x nibble). PT semantics per Protracker-effects-MODFIL12.txt 7:Tremolo say the per-nibble memory operates independently from vibrato’s.

§trem_depth: u8

Tremolo depth memory (last non-zero 7xy y nibble).

§note_cut_tick: u8

Pending note-cut tick (ECx): if >0, volume forced to 0 on that tick.

§note_delay_tick: u8

Pending note-delay tick (EDx): if >0, the cell’s note is triggered on this tick instead of tick 0.

§pending_note: (u8, u8)

Saved trigger data for a pending note-delay.

§pending_instrument: u8§pending_volume: u8§has_pending_delay: bool

True if the pending note-delay slot is populated.

Trait Implementations§

Source§

impl Clone for StmChannel

Source§

fn clone(&self) -> StmChannel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StmChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StmChannel

Source§

fn default() -> StmChannel

Returns the “default value” for a type. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.