Skip to main content

AudioFeatures

Struct AudioFeatures 

Source
pub struct AudioFeatures {
Show 15 fields pub centroid_mean: f64, pub centroid_std: f64, pub rolloff_mean: f64, pub flatness_mean: f64, pub flux_mean: f64, pub zcr_mean: f64, pub rms_mean: f64, pub rms_std: f64, pub crest: f64, pub attack_s: f64, pub tail_ratio: f64, pub bass_fraction: f64, pub held_centroid_std: f64, pub high_ratio: f64, pub chord_flatness_delta: f64,
}
Expand description

Named perceptual descriptors. to_vec order matches AudioFeatures::NAMES.

Fields§

§centroid_mean: f64

Mean spectral centroid on the log_axis (octaves above 20 Hz, 1.0 = Nyquist) — brightness.

§centroid_std: f64

Std of the log-axis centroid over frames — timbral movement, in octaves, so a wobble means the same thing at any register.

§rolloff_mean: f64

Mean 85% spectral rolloff on the log_axis.

§flatness_mean: f64

Mean spectral flatness (0 tonal … 1 noisy).

§flux_mean: f64

Mean spectral flux — how fast the spectrum changes.

§zcr_mean: f64

Zero-crossing rate as an equivalent frequency, on the log_axis.

§rms_mean: f64

Mean frame RMS of the normalized render.

§rms_std: f64

Std of frame RMS — dynamics/movement.

§crest: f64

ln crest factor: ln(peak / whole-phrase RMS). Logged because the raw factor is heavy-tailed (1 … 40+).

§attack_s: f64

ln(attack + 5 ms) of the first note (onset → 90% of that note’s peak RMS, interpolated between envelope hops).

§tail_ratio: f64

ln tail level: RMS of the final 300 ms relative to whole-phrase RMS — captures release length and delay/reverb tails. Logged: the raw ratio spans three orders of magnitude.

§bass_fraction: f64

Low-band energy fraction (below ~250 Hz) — weight/sub character.

§held_centroid_std: f64

Std of the log-axis centroid over frames of the held note’s gate-on span only. centroid_std over the whole phrase conflates note-to-note register jumps with genuine timbral motion; this coordinate is register-constant by construction, so it is the axis on which “a filter sweeping at 0.4 Hz” and “a static patch” are different patches at all. 0.0 when the phrase has no held span long enough to measure.

§high_ratio: f64

ln RMS of the highest note’s gate-on span relative to the held note’s — does the patch speak in the upper register, or does its filter choke it? 0.0 when the phrase has no note meaningfully above its first.

§chord_flatness_delta: f64

Mean spectral flatness over the chord note’s gate-on span minus the held note’s — intermodulation and mud when voices stack. 0.0 when the phrase has no chord note.

Implementations§

Source§

impl AudioFeatures

Source

pub const NAMES: [&'static str; 15]

Feature names in to_vec order.

§The :p2 stimulus tag

Every audio feature is a measurement of the standard phrase, so a stimulus change changes what each value means even when the formula is untouched — a slow pad’s rms_mean under a phrase that never lets it open is a different quantity from the same field under one that does. The observation log stores raw φ by name, and FitSet::build projects old logs onto the current names: same name ⇒ same coordinate. Tagging the names with the stimulus generation is therefore the migration mechanism itself — votes recorded under the v1 phrase keep their (stimulus-independent) structural coordinates and have their old-stimulus audio coordinates honestly imputed as “no evidence”, instead of being silently mixed into a standardizer they were never commensurable with. Bump the tag whenever PhraseSpec::default changes audibly.

Source

pub fn to_vec(&self) -> Vec<f64>

Flatten to a vector in Self::NAMES order.

Trait Implementations§

Source§

impl Clone for AudioFeatures

Source§

fn clone(&self) -> AudioFeatures

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 AudioFeatures

Source§

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

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

impl<'de> Deserialize<'de> for AudioFeatures

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for AudioFeatures

Source§

fn eq(&self, other: &AudioFeatures) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AudioFeatures

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for AudioFeatures

Source§

impl StructuralPartialEq for AudioFeatures

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,