Module freq

Module freq 

Source
Expand description

The freq module defines the Frequency type and its associated traits and implementations.

Structs§

Frequency
The Frequency type is a generic wrapper around type T that implements the RawFrequency trait. 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
AsFrequency is a trait enabling the conversion of a reference to a type into a Frequency instance.
FrequencyNum
The FrequencyNum trait extends the RawFrequency trait with additional numeric operations and traits.
IntoFrequency
The IntoFrequency trait consumes the value and converts it into a Frequency.
RawFrequency
RawFrequency defines 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).