[][src]Struct aubio_rs::Onset

pub struct Onset { /* fields omitted */ }

Onset detection object

The following routines compute the onset detection function and detect peaks in these functions. When onsets are found above a given silence threshold, and after a minimum inter-onset interval, the output vector returned by do_() is filled with 1. Otherwise, the output vector remains 0.

The peak-picking threshold, the silence threshold, and the minimum inter-onset interval can be adjusted during the execution of the do_() routine using the corresponding functions.

Methods

impl Onset[src]

pub fn new(
    method: OnsetMode,
    buf_size: usize,
    hop_size: usize,
    sample_rate: u32
) -> Result<Self>
[src]

Create onset detection object

  • method Onset detection type
  • buf_size Buffer size for phase vocoder
  • hop_size Hop size for phase vocoder
  • sample_rate Sampling rate of the input signal

pub fn with_awhitening(self, enable: bool) -> Self[src]

Set onset detection adaptive whitening

pub fn with_compression(self, lambda: f32) -> Self[src]

Set or disable log compression

pub fn with_silence(self, silence: f32) -> Self[src]

Set onset detection silence threshold

pub fn with_threshold(self, threshold: f32) -> Self[src]

Set onset detection peak picking threshold

pub fn with_minioi(self, minioi: usize) -> Self[src]

Set minimum inter onset interval in samples

pub fn with_minioi_s(self, minioi: f32) -> Self[src]

Set minimum inter onset interval in seconds

pub fn with_minioi_ms(self, minioi: f32) -> Self[src]

Set minimum inter onset interval in milliseconds

pub fn with_delay(self, delay: usize) -> Self[src]

Set delay in samples

pub fn with_delay_s(self, delay: f32) -> Self[src]

Set delay in seconds

pub fn with_delay_ms(self, delay: f32) -> Self[src]

Set delay in milliseconds

pub fn do_<'i, 'o, I, O>(&mut self, input: I, onset: O) -> Status where
    I: Into<FVec<'i>>,
    O: Into<FVecMut<'o>>, 
[src]

Execute onset detection

When no onset was detected, the first element of the output vector onset is set to 0.

When an onset is found, the first element of the output vector onset is set to offset = 1 + a where a is a number in the range[0, 1].

The final onset detection time, in samples, can be obtained with Onset::get_last(). It can also be derived from offset as follows:

t = total_frames + offset * hop_size - delay

where total_frames is the total number of frames processed so far, and delay is the current delay of the onset object, as returned by Onset::get_delay().

pub fn do_result<'i, I>(&mut self, input: I) -> Result<f32> where
    I: Into<FVec<'i>>, 
[src]

Execute onset detection

pub fn get_hop(&self) -> usize[src]

Get hop size

pub fn get_last(&self) -> usize[src]

Get the time of the latest onset detected, in samples

pub fn get_last_s(&self) -> f32[src]

Get the time of the latest onset detected, in seconds

pub fn get_last_ms(&self) -> f32[src]

Get the time of the latest onset detected, in milliseconds

pub fn set_awhitening(&mut self, enable: bool)[src]

Set onset detection adaptive whitening

pub fn get_awhitening(&self) -> bool[src]

Get onset detection adaptive whitening

pub fn set_compression(&mut self, lambda: f32)[src]

Set or disable log compression

pub fn get_compression(&self) -> f32[src]

Get onset detection log compression

pub fn set_silence(&mut self, silence: f32)[src]

Set onset detection silence threshold

pub fn get_silence(&self) -> f32[src]

Get onset detection silence threshold

pub fn get_descriptor(&self) -> f32[src]

Get onset detection function

pub fn get_thresholded_descriptor(&self) -> f32[src]

Get thresholded onset detection function

pub fn set_threshold(&mut self, threshold: f32)[src]

Set onset detection peak picking threshold

pub fn get_threshold(&self) -> f32[src]

Get onset peak picking threshold

pub fn set_minioi(&mut self, minioi: usize)[src]

Set minimum inter onset interval in samples

pub fn get_minioi(&self) -> usize[src]

Get minimum inter onset interval in samples

pub fn set_minioi_s(&mut self, minioi: f32)[src]

Set minimum inter onset interval in seconds

pub fn get_minioi_s(&self) -> f32[src]

Get minimum inter onset interval in seconds

pub fn set_minioi_ms(&mut self, minioi: f32)[src]

Set minimum inter onset interval in milliseconds

pub fn get_minioi_ms(&self) -> f32[src]

Get minimum inter onset interval in milliseconds

pub fn set_delay(&mut self, delay: usize)[src]

Set delay in samples

pub fn get_delay(&self) -> usize[src]

Get delay in samples

pub fn set_delay_s(&mut self, delay: f32)[src]

Set delay in seconds

pub fn get_delay_s(&self) -> f32[src]

Get delay in seconds

pub fn set_delay_ms(&mut self, delay: f32)[src]

Set delay in milliseconds

pub fn get_delay_ms(&self) -> f32[src]

Get delay in milliseconds

pub fn set_default_parameters(&mut self, mode: OnsetMode)[src]

Set default parameters

pub fn reset(&mut self)[src]

Reset onset detection

Trait Implementations

impl Drop for Onset[src]

Auto Trait Implementations

impl RefUnwindSafe for Onset

impl !Send for Onset

impl !Sync for Onset

impl Unpin for Onset

impl UnwindSafe for Onset

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.