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
| function blob_to_buffer(blob, callback) { | |
| const file_reader = new FileReader() | |
| file_reader.addEventListener("loadend", event => { | |
| if (file_reader.error) { | |
| callback(file_reader.error) | |
| } else { | |
| callback(null, new Buffer(file_reader.result)) | |
| } | |
| }, false) |
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
| 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' |