Created
September 14, 2026 03:46
-
-
Save StartAutomating/716a5a019fca369e75d0f94fd2ac2d6f to your computer and use it in GitHub Desktop.
Gist convert from midi note to frequency
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
| <# | |
| .SYNOPSIS | |
| Converts Midi to a Frequency | |
| .DESCRIPTION | |
| Converts a Midi note value to an audio frequency | |
| .LINK | |
| https://en.wikipedia.org/wiki/MIDI_tuning_standard | |
| #> | |
| param( | |
| # The midi note number | |
| [ValidateRange(0,127)] | |
| [double]$MidiNote = 69 | |
| ) | |
| # Multiply 440 by 2^(($MidiNote-19)/12) | |
| 440.0 * [Math]::Pow( | |
| 2, | |
| (($MidiNote - 69)/12) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment