Loading prj_rust_05_note...
let my_note = Note::new(Key::Gsharp, 3, 2.5, 0.75, 0.25);
let the_frequency = my_note.frequency();
const A4_FREQUENCY: f32 = 440.0; const SEMITONE: f64 = 1.059_463_094_359_295_3; // 2^(1/12) let k_offset = key as i32 - 9; // relative to A (key number 9) let o_offset = 12 * (octave - 4); // relative to octave 4 let frequency = A4_FREQUENCY * SEMITONE.powi(k_offset + o_offset) as f32;