This repository has been archived on 2019-12-11. You can view files and clone it, but cannot push or open issues/pull-requests.
jlaudio/lib/util/notefreq.go

9 lines
163 B
Go
Raw Normal View History

2019-12-02 19:47:40 +00:00
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
}