9 lines
163 B
Go
9 lines
163 B
Go
|
package util
|
||
|
|
||
|
import "math"
|
||
|
|
||
|
// Return the frequency of a given MIDI note number.
|
||
|
func NoteFreq(n int) float64 {
|
||
|
return (math.Pow(2, (float64(n)-69)/12)) * 440
|
||
|
}
|