1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Appellation: frequency <module>
Created At: 2025.12.29:16:52:31
Contrib: @FL03
*/
use ;
/// Given some pitch class $`n`$ (in semitones) and an optional base frequency $`\beta`$ (in hertz),
/// calculate the corresponding frequency $`f`$.
///
/// ```math
/// F=\beta\cdot{2^{\frac{n}{12}}}
/// ```
/// Compute the pitch class of a frequency (in hertz), using the formula:
///
/// ```math
/// n = 12\cdot\log_{2}(\frac{F}{\beta})
/// ```