Struct rustchord::Notefinder
source · [−]pub struct Notefinder { /* private fields */ }
Implementations
Create a new instance of the Notefinder with the desired samplerate.
Samplerate can only be set during creation.
Use this to change the Discrete Fourier transform algorithm.
Options defined in DFTAlgorithm
Sets the span of octaves Defaults to 8
pub 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
Set the base Hz for the notefinder to start at Defaults to 0
pub 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
pub 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.
pub 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
pub fn set_amplification(
&self,
amplification: f32
) -> Result<(), NoteFinderValidationError<f32>>
pub fn set_amplification(
&self,
amplification: f32
) -> Result<(), NoteFinderValidationError<f32>>
Amplify input across the board
pub 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.
pub 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.
pub 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
The “tightness” of the curve, or how many samples back to look? Defaults to 16
pub 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.”
pub 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
pub 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_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>>
pub 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
pub 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
IIR (infinite impulse response) to impose the output of the IIR.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Notefinder
impl !Sync for Notefinder
impl Unpin for Notefinder
impl UnwindSafe for Notefinder
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more