pub fn equal_tempered_scale_note_freqs(
    hz: f32,
    n0: i16,
    steps: i16
) -> impl IntoIterator<Item = f32> + Clone + ExactSizeIterator
Expand description

Returns an iterator of equal-tempered scale frequencies (in a single octave) obtained from a given base frequency.

hz base frequency is in Hz (use 440.0 as a good default). n0 an index from the base frequency to the first note in the table: 0 is for “A” note, -9 for “C”. steps determines how many halftones will be rendered, (12 is the usual number).

Examples found in repository?
src/music.rs (line 31)
28
29
30
31
32
33
34
pub fn render_equal_tempered_scale_note_freqs(hz: f32, n0: i16, target: &mut [f32]) {
    let steps = target.len().try_into().expect("target is too large");
    for (t, hz) in target.iter_mut()
                   .zip(equal_tempered_scale_note_freqs(hz, n0, steps)) {
        *t = hz
    }
}