pub struct Tempo { /* private fields */ }
Expand description
Tempo detection object
Implementations§
Source§impl Tempo
impl Tempo
Sourcepub fn new(
method: OnsetMode,
buf_size: usize,
hop_size: usize,
sample_rate: u32,
) -> Result<Self>
pub fn new( method: OnsetMode, buf_size: usize, hop_size: usize, sample_rate: u32, ) -> Result<Self>
Create tempo detection object
method
Beat tracking methodbuf_size
Length of FFThop_size
Number of frames between two consecutive runssample_rate
Sampling rate of the signal to analyze
Sourcepub fn with_silence(self, silence: Smpl) -> Self
pub fn with_silence(self, silence: Smpl) -> Self
Set tempo detection silence threshold
Sourcepub fn with_threshold(self, threshold: Smpl) -> Self
pub fn with_threshold(self, threshold: Smpl) -> Self
Set tempo detection peak picking threshold
Sourcepub fn with_delay(self, delay: isize) -> Self
pub fn with_delay(self, delay: isize) -> Self
Set current delay in samples
Sourcepub fn with_delay_s(self, delay: Smpl) -> Self
pub fn with_delay_s(self, delay: Smpl) -> Self
Set current delay in seconds
Sourcepub fn with_delay_ms(self, delay: Smpl) -> Self
pub fn with_delay_ms(self, delay: Smpl) -> Self
Set current delay in milliseconds
Sourcepub fn get_last_s(&self) -> Smpl
pub fn get_last_s(&self) -> Smpl
Get the time of the latest beat detected, in seconds
Sourcepub fn get_last_ms(&self) -> Smpl
pub fn get_last_ms(&self) -> Smpl
Get the time of the latest beat detected, in milliseconds
Sourcepub fn set_silence(&mut self, silence: Smpl)
pub fn set_silence(&mut self, silence: Smpl)
Set tempo detection silence threshold
Sourcepub fn get_silence(&self) -> Smpl
pub fn get_silence(&self) -> Smpl
Get tempo detection silence threshold
Sourcepub fn set_threshold(&mut self, threshold: Smpl)
pub fn set_threshold(&mut self, threshold: Smpl)
Set tempo detection peak picking threshold
Sourcepub fn get_threshold(&self) -> Smpl
pub fn get_threshold(&self) -> Smpl
Get tempo peak picking threshold
Sourcepub fn get_period(&self) -> usize
pub fn get_period(&self) -> usize
Get the current beat period in samples
Sourcepub fn get_period_s(&self) -> Smpl
pub fn get_period_s(&self) -> Smpl
Get the current beat period in seconds
Sourcepub fn get_confidence(&self) -> Smpl
pub fn get_confidence(&self) -> Smpl
Get the current tempo confidence
Sourcepub fn set_tatum_signature(&mut self, signature: u32)
pub fn set_tatum_signature(&mut self, signature: u32)
Set number of tatum per beat
Sourcepub fn get_last_tatum(&self) -> Smpl
pub fn get_last_tatum(&self) -> Smpl
Get position of last tatum in samples
Sourcepub fn set_delay_s(&mut self, delay: Smpl)
pub fn set_delay_s(&mut self, delay: Smpl)
Set current delay in seconds
Sourcepub fn get_delay_s(&self) -> Smpl
pub fn get_delay_s(&self) -> Smpl
Get current delay in seconds
Sourcepub fn set_delay_ms(&mut self, delay: Smpl)
pub fn set_delay_ms(&mut self, delay: Smpl)
Set current delay in milliseconds
Sourcepub fn get_delay_ms(&self) -> Smpl
pub fn get_delay_ms(&self) -> Smpl
Get current delay in milliseconds