Last active
December 21, 2024 19:44
-
-
Save gustavopsantos/d5785ff2c9bcee016c545a4801f6055c to your computer and use it in GitHub Desktop.
Musical note frequency calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static float Calc(float referenceFrequency, float noteOffset) // For instance: Calc(440, 12) = 880 | 440Hz = A4 | 880Hz = A5 | |
| { | |
| return (float) (Math.Pow(2, noteOffset / 12) * referenceFrequency); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment