Skip to main content

UiMetrics

Struct UiMetrics 

#[repr(C)]
pub struct UiMetrics {
Show 29 fields pub input_rms_db: f32, pub output_rms_db: f32, pub input_peak_db: f32, pub output_peak_db: f32, pub gain_reduction_db: f32, pub tube_plate_current: [f32; 12], pub tube_dissipation: [f32; 12], pub tube_count: u8, pub transformer_flux: [f32; 4], pub transformer_count: u8, pub signal_min: f32, pub signal_max: f32, pub lfo_phase: f32, pub supply_voltage: f32, pub supply_sag: f32, pub stage_levels: [f32; 16], pub stage_count: u8, pub nr_solve_count: u32, pub nr_total_iterations: u32, pub nr_max_iterations: u16, pub nr_nonconverged_count: u16, pub nr_max_residual: f32, pub stage_nr_iterations: [u16; 16], pub stage_nr_residual: [f32; 16], pub stage_nr_nonconverged: [u8; 16], pub nonfinite_count: u32, pub blowup_count: u32, pub max_abs_sample: f32, pub block_counter: u32,
}
Expand description

Metrics exported from the audio thread for UI visualization.

This struct is written by the audio thread every block_size samples (typically 128 or 256) and read by the UI thread at ~60fps.

Fields§

§input_rms_db: f32

Input RMS level (dB, typically -60 to +6).

§output_rms_db: f32

Output RMS level (dB).

§input_peak_db: f32

Input peak level (dB) — instant attack, slow decay in accumulator.

§output_peak_db: f32

Output peak level (dB).

§gain_reduction_db: f32

Gain reduction in dB (0 = no reduction, negative = compression).

§tube_plate_current: [f32; 12]

Per-tube plate current (mA). Higher current = brighter glow.

§tube_dissipation: [f32; 12]

Per-tube plate dissipation (watts = Vpk * Ip).

§tube_count: u8

Number of active tubes in this circuit.

§transformer_flux: [f32; 4]

Core flux as fraction of saturation (0.0 = idle, 1.0 = saturating).

§transformer_count: u8

Number of active transformers in this circuit.

§signal_min: f32

Minimum sample value in this block (for envelope display).

§signal_max: f32

Maximum sample value in this block (for envelope display).

§lfo_phase: f32

LFO phase (0.0-1.0) for tremolo/vibrato pulse indicator.

§supply_voltage: f32

Current B+ voltage. Drops under load (tube sag).

§supply_sag: f32

Supply sag as fraction (0.0 = full voltage, 1.0 = max sag).

§stage_levels: [f32; 16]

RMS level at each circuit stage (normalized 0-1 for shader).

§stage_count: u8

Number of active stages.

§nr_solve_count: u32

Total nonlinear/coupled solve calls observed in this metrics block.

§nr_total_iterations: u32

Total Newton/fixed-point iterations across solve calls in this block.

§nr_max_iterations: u16

Maximum iterations used by any solve in this block.

§nr_nonconverged_count: u16

Number of solves that did not converge in this block.

§nr_max_residual: f32

Maximum final residual observed in this block.

§stage_nr_iterations: [u16; 16]

Per-stage maximum iterations observed in this block.

§stage_nr_residual: [f32; 16]

Per-stage maximum final residual observed in this block.

§stage_nr_nonconverged: [u8; 16]

Per-stage non-convergence counts, saturated at u8::MAX.

§nonfinite_count: u32

Non-finite inputs, intermediate values, or outputs observed this block.

§blowup_count: u32

Samples whose magnitude exceeded a conservative blowup threshold.

§max_abs_sample: f32

Largest absolute signal magnitude observed this block.

§block_counter: u32

Block counter (monotonic, wraps at u32::MAX).

Implementations§

§

impl UiMetrics

pub fn new() -> UiMetrics

Create zeroed metrics.

Trait Implementations§

§

impl Clone for UiMetrics

§

fn clone(&self) -> UiMetrics

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
§

impl Copy for UiMetrics

§

impl Debug for UiMetrics

§

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

Formats the value using the given formatter. Read more
§

impl Default for UiMetrics

§

fn default() -> UiMetrics

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more