AnalysisIndex

Enum AnalysisIndex 

Source
pub enum AnalysisIndex {
Show 23 variants Tempo, Zcr, MeanSpectralCentroid, StdDeviationSpectralCentroid, MeanSpectralRolloff, StdDeviationSpectralRolloff, MeanSpectralFlatness, StdDeviationSpectralFlatness, MeanLoudness, StdDeviationLoudness, Chroma1, Chroma2, Chroma3, Chroma4, Chroma5, Chroma6, Chroma7, Chroma8, Chroma9, Chroma10, Chroma11, Chroma12, Chroma13,
}
Expand description

Indexes different fields of an Analysis.

  • Example:
use bliss_audio::{AnalysisIndex, BlissResult, Song};

fn main() -> BlissResult<()> {
    // Should be an actual track loaded with a Decoder, but using an empty
    // song for simplicity's sake
    let song = Song::default();
    println!("{}", song.analysis[AnalysisIndex::Tempo]);
    Ok(())
}

Prints the tempo value of an analysis.

Note that this should mostly be used for debugging / distance metric customization purposes.

Variants§

§

Tempo

The song’s tempo.

§

Zcr

The song’s zero-crossing rate.

§

MeanSpectralCentroid

The mean of the song’s spectral centroid.

§

StdDeviationSpectralCentroid

The standard deviation of the song’s spectral centroid.

§

MeanSpectralRolloff

The mean of the song’s spectral rolloff.

§

StdDeviationSpectralRolloff

The standard deviation of the song’s spectral rolloff.

§

MeanSpectralFlatness

The mean of the song’s spectral flatness.

§

StdDeviationSpectralFlatness

The standard deviation of the song’s spectral flatness.

§

MeanLoudness

The mean of the song’s loudness.

§

StdDeviationLoudness

The standard deviation of the song’s loudness.

§

Chroma1

The proportion of pitch class set 1 (IC1) compared to the 6 other pitch class sets, per this paper https://speech.di.uoa.gr/ICMC-SMC-2014/images/VOL_2/1461.pdf

§

Chroma2

The proportion of pitch class set 2 (IC2) compared to the 6 other pitch class sets, per this paper https://speech.di.uoa.gr/ICMC-SMC-2014/images/VOL_2/1461.pdf

§

Chroma3

The proportion of pitch class set 3 (IC3) compared to the 6 other pitch class sets, per this paper https://speech.di.uoa.gr/ICMC-SMC-2014/images/VOL_2/1461.pdf

§

Chroma4

The proportion of pitch class set 4 (IC4) compared to the 6 other pitch class sets, per this paper https://speech.di.uoa.gr/ICMC-SMC-2014/images/VOL_2/1461.pdf

§

Chroma5

The proportion of pitch class set 5 (IC5) compared to the 6 other pitch class sets, per this paper https://speech.di.uoa.gr/ICMC-SMC-2014/images/VOL_2/1461.pdf

§

Chroma6

The proportion of pitch class set 6 (IC6) compared to the 6 other pitch class sets, per this paper https://speech.di.uoa.gr/ICMC-SMC-2014/images/VOL_2/1461.pdf

§

Chroma7

The proportion of major triads in the song, compared to the other triads.

§

Chroma8

The proportion of minor triads in the song, compared to the other triads.

§

Chroma9

The proportion of diminished triads in the song, compared to the other triads.

§

Chroma10

The proportion of augmented triads in the song, compared to the other triads.

§

Chroma11

The L2-norm of the IC1-6 (see above).

§

Chroma12

The L2-norm of the IC7-10 (see above).

§

Chroma13

The ratio of the L2-norm of IC7-10 and IC1-6 (proportion of triads vs dyads).

Implementations§

Source§

impl AnalysisIndex

Source

pub const FEATURES_VERSION: FeaturesVersion = FeaturesVersion::LATEST

The features version associated with this analysis index.

Trait Implementations§

Source§

impl Debug for AnalysisIndex

Source§

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

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

impl EnumCount for AnalysisIndex

Source§

const COUNT: usize = 23usize

Source§

impl Index<AnalysisIndex> for Analysis

Source§

type Output = f32

The returned type after indexing.
Source§

fn index(&self, index: AnalysisIndex) -> &f32

Performs the indexing (container[index]) operation. Read more
Source§

impl IntoEnumIterator for AnalysisIndex

Source§

type Iterator = AnalysisIndexIter

Source§

fn iter() -> AnalysisIndexIter

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

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

Source§

fn vzip(self) -> V