pub struct Notefinder { /* private fields */ }
Implementations§
Source§impl Notefinder
impl Notefinder
Sourcepub fn new(samplerate: i32) -> Notefinder
pub fn new(samplerate: i32) -> Notefinder
Create a new instance of the Notefinder with the desired samplerate.
Samplerate can only be set during creation.
pub fn get_folded<'a>(&'a self) -> &'a [f32]
Sourcepub fn set_dft_algorithm(&mut self, algo: DFTAlgorithm)
pub fn set_dft_algorithm(&mut self, algo: DFTAlgorithm)
Use this to change the Discrete Fourier transform algorithm.
Options defined in DFTAlgorithm
Sourcepub fn set_octaves(
&self,
octaves: i32,
) -> Result<(), NoteFinderValidationError<i32>>
pub fn set_octaves( &self, octaves: i32, ) -> Result<(), NoteFinderValidationError<i32>>
Sets the span of octaves Defaults to 8
Sourcepub fn set_frequency_bins(
&self,
frequency_bins: i32,
) -> Result<(), NoteFinderValidationError<i32>>
pub fn set_frequency_bins( &self, frequency_bins: i32, ) -> Result<(), NoteFinderValidationError<i32>>
Defines the number of frequency bins Defaults to 24
Sourcepub fn set_base_hz(
&self,
base_hz: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_base_hz( &self, base_hz: f32, ) -> Result<(), NoteFinderValidationError<f32>>
Set the base Hz for the notefinder to start at Defaults to 0
Sourcepub fn set_filter_strength(
&self,
filter_strength: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_filter_strength( &self, filter_strength: f32, ) -> Result<(), NoteFinderValidationError<f32>>
Controls the strength of the filter Defaults to 0.5
Sourcepub fn set_filter_iterations(
&self,
filter_iterations: i32,
) -> Result<(), NoteFinderValidationError<i32>>
pub fn set_filter_iterations( &self, filter_iterations: i32, ) -> Result<(), NoteFinderValidationError<i32>>
Set filter iterations, the higher the better but does cost CPU Defaults to 1.
Sourcepub fn set_decompose_iterations(
&self,
decompose_iterations: i32,
) -> Result<(), NoteFinderValidationError<i32>>
pub fn set_decompose_iterations( &self, decompose_iterations: i32, ) -> Result<(), NoteFinderValidationError<i32>>
Set decompose iterations, defaults to 1000
Sourcepub fn set_amplification(
&self,
amplification: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_amplification( &self, amplification: f32, ) -> Result<(), NoteFinderValidationError<f32>>
Amplify input across the board
Sourcepub fn set_compress_exponent(
&self,
compress_exponent: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_compress_exponent( &self, compress_exponent: f32, ) -> Result<(), NoteFinderValidationError<f32>>
How much to compress the sound by before putting it into the compressor.
Sourcepub fn set_compress_coefficient(
&self,
compress_coefficient: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_compress_coefficient( &self, compress_coefficient: f32, ) -> Result<(), NoteFinderValidationError<f32>>
Exponent of the compressor lower = make more uniform.
Sourcepub fn set_dft_speedup(
&self,
dft_speedup: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_dft_speedup( &self, dft_speedup: f32, ) -> Result<(), NoteFinderValidationError<f32>>
At 300, there is still some minimal aliasing at higher frequencies. Increase this for less low-end distortion Defaults to 300
Sourcepub fn set_dft_q(
&self,
dft_q: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_dft_q( &self, dft_q: f32, ) -> Result<(), NoteFinderValidationError<f32>>
The “tightness” of the curve, or how many samples back to look? Defaults to 16
Sourcepub fn set_default_sigma(
&self,
default_sigma: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_default_sigma( &self, default_sigma: f32, ) -> Result<(), NoteFinderValidationError<f32>>
This controls the expected shape of the normal distributions. Defaults to 1.4
Author of Colorchord notes “I am not sure how to calculate this from samplerate, Q and bins.”
Sourcepub fn set_note_jumpability(
&self,
note_jumpability: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_jumpability( &self, note_jumpability: f32, ) -> Result<(), NoteFinderValidationError<f32>>
How far established notes are allowed to “jump” in order to attach themselves to a new “peak” Default 0.5
Sourcepub fn set_note_combine_distance(
&self,
note_combine_distance: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_combine_distance( &self, note_combine_distance: f32, ) -> Result<(), NoteFinderValidationError<f32>>
How close established notes need to be to each other before they can be “combined” into a single note. Defaults to 0.5
pub fn set_slope( &self, slope: f32, ) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_attach_freq_iir( &self, note_attach_freq_iir: f32, ) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_attach_amp_iir( &self, note_attach_amp_iir: f32, ) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_attach_amp_iir2( &self, note_attach_amp_iir2: f32, ) -> Result<(), NoteFinderValidationError<f32>>
Sourcepub fn set_note_minimum_new_distribution_value(
&self,
note_minimum_new_distribution_value: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_minimum_new_distribution_value( &self, note_minimum_new_distribution_value: f32, ) -> Result<(), NoteFinderValidationError<f32>>
A distribution must be /this/ big otherwise, it will be discarded. Defaults to 0.02
Sourcepub fn set_note_out_chop(
&self,
note_out_chop: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_note_out_chop( &self, note_out_chop: f32, ) -> Result<(), NoteFinderValidationError<f32>>
How much to decimate the output notes to reduce spurious noise
Sourcepub fn set_dft_iir(
&self,
dft_iir: f32,
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_dft_iir( &self, dft_iir: f32, ) -> Result<(), NoteFinderValidationError<f32>>
IIR (infinite impulse response) to impose the output of the IIR.
Trait Implementations§
impl Send for Notefinder
Auto Trait Implementations§
impl Freeze for Notefinder
impl RefUnwindSafe for Notefinder
impl !Sync for Notefinder
impl Unpin for Notefinder
impl UnwindSafe for Notefinder
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more