Expand description
The freq module defines the Frequency type and its associated traits and implementations.
Structs§
- Frequency
- The
Frequencytype is a generic wrapper around typeTthat implements theRawFrequencytrait. This implementation is designed to provide a consistent interface for dealing with frequencies within the crate, enabling conversion, arithmetic operations, and other utilities that are common to frequency values.
Traits§
- AsFrequency
AsFrequencyis a trait enabling the conversion of a reference to a type into aFrequencyinstance.- Frequency
Num - The
FrequencyNumtrait extends theRawFrequencytrait with additional numeric operations and traits. - Into
Frequency - The
IntoFrequencytrait consumes the value and converts it into aFrequency. - RawFrequency
RawFrequencydefines an interface for all raw Frequency types.
Functions§
- map_
to_ c_ major - Maps a frequency to the nearest pitch class in the C Major scale (C=0, D=2, E=4, F=5, G=7, A=9, B=11). The input frequency is in Hz, and T is a floating-point type (e.g., f32, f64).