-
-
Save 1j01/168a622ee16fa1d4722e to your computer and use it in GitHub Desktop.
This file contains 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
notes = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'] | |
getFrequency = (noten)-> | |
440 * 2 ** ((noten - 49) / notes.length) | |
getNoteN = (notestr)-> | |
i = notes.indexOf notestr[0...-1] | |
octave = parseInt notestr[-1..] | |
octave -= 1 if i >= notes.indexOf 'C' | |
octave * notes.length + i + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment