pub struct ChannelState {
pub tone_period: u16,
pub frequency_hz: Option<f32>,
pub note_name: Option<&'static str>,
pub midi_note: Option<u8>,
pub amplitude: u8,
pub amplitude_normalized: f32,
pub tone_enabled: bool,
pub noise_enabled: bool,
pub envelope_enabled: bool,
}Expand description
State of a single YM2149 channel extracted from registers.
Fields§
§tone_period: u16Tone period from registers (12-bit, 0-4095).
frequency_hz: Option<f32>Calculated frequency in Hz (None if period is 0).
note_name: Option<&'static str>Musical note name (e.g., “A4”, “C#5”).
midi_note: Option<u8>MIDI note number (21-108 for piano range, None if out of range).
amplitude: u8Raw amplitude value (0-15).
amplitude_normalized: f32Normalized amplitude (0.0-1.0) for visualization.
tone_enabled: boolWhether tone output is enabled for this channel.
noise_enabled: boolWhether noise output is enabled for this channel.
envelope_enabled: boolWhether envelope mode is enabled (bit 4 of amplitude register).
Trait Implementations§
Source§impl Clone for ChannelState
impl Clone for ChannelState
Source§fn clone(&self) -> ChannelState
fn clone(&self) -> ChannelState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChannelState
impl Debug for ChannelState
Source§impl Default for ChannelState
impl Default for ChannelState
Source§fn default() -> ChannelState
fn default() -> ChannelState
Returns the “default value” for a type. Read more
impl Copy for ChannelState
Auto Trait Implementations§
impl Freeze for ChannelState
impl RefUnwindSafe for ChannelState
impl Send for ChannelState
impl Sync for ChannelState
impl Unpin for ChannelState
impl UnwindSafe for ChannelState
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