Tempo

Struct Tempo 

Source
pub struct Tempo { /* private fields */ }
Expand description

Tempo detection object

Implementations§

Source§

impl Tempo

Source

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

Create tempo detection object

  • method Beat tracking method
  • buf_size Length of FFT
  • hop_size Number of frames between two consecutive runs
  • sample_rate Sampling rate of the signal to analyze
Source

pub fn with_silence(self, silence: Smpl) -> Self

Set tempo detection silence threshold

Source

pub fn with_threshold(self, threshold: Smpl) -> Self

Set tempo detection peak picking threshold

Source

pub fn with_delay(self, delay: isize) -> Self

Set current delay in samples

Source

pub fn with_delay_s(self, delay: Smpl) -> Self

Set current delay in seconds

Source

pub fn with_delay_ms(self, delay: Smpl) -> Self

Set current delay in milliseconds

Source

pub fn get_hop(&self) -> usize

Get hop size

Source

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

Execute tempo detection

Source

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

Execute tempo detection

Source

pub fn get_last(&self) -> usize

Get the time of the latest beat detected, in samples

Source

pub fn get_last_s(&self) -> Smpl

Get the time of the latest beat detected, in seconds

Source

pub fn get_last_ms(&self) -> Smpl

Get the time of the latest beat detected, in milliseconds

Source

pub fn set_silence(&mut self, silence: Smpl)

Set tempo detection silence threshold

Source

pub fn get_silence(&self) -> Smpl

Get tempo detection silence threshold

Source

pub fn set_threshold(&mut self, threshold: Smpl)

Set tempo detection peak picking threshold

Source

pub fn get_threshold(&self) -> Smpl

Get tempo peak picking threshold

Source

pub fn get_period(&self) -> usize

Get the current beat period in samples

Source

pub fn get_period_s(&self) -> Smpl

Get the current beat period in seconds

Source

pub fn get_bpm(&self) -> Smpl

Get the current tempo

Source

pub fn get_confidence(&self) -> Smpl

Get the current tempo confidence

Source

pub fn set_tatum_signature(&mut self, signature: u32)

Set number of tatum per beat

Source

pub fn was_tatum(&self) -> u32

Check whether a tatum was detected in the current frame

Source

pub fn get_last_tatum(&self) -> Smpl

Get position of last tatum in samples

Source

pub fn set_delay(&mut self, delay: isize)

Set current delay in samples

Source

pub fn get_delay(&self) -> usize

Get current delay in samples

Source

pub fn set_delay_s(&mut self, delay: Smpl)

Set current delay in seconds

Source

pub fn get_delay_s(&self) -> Smpl

Get current delay in seconds

Source

pub fn set_delay_ms(&mut self, delay: Smpl)

Set current delay in milliseconds

Source

pub fn get_delay_ms(&self) -> Smpl

Get current delay in milliseconds

Trait Implementations§

Source§

impl Drop for Tempo

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Tempo

§

impl RefUnwindSafe for Tempo

§

impl !Send for Tempo

§

impl !Sync for Tempo

§

impl Unpin for Tempo

§

impl UnwindSafe for Tempo

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