Skip to content

Instantly share code, notes, and snippets.

View rlamana's full-sized avatar

Ramón Lamana rlamana

View GitHub Profile
// Takes string of Note + Octave
// Example:
// var frequency = getFrequency('C3');
var getFrequency = function (note) {
var notes = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'],
octave,
keyNumber;
if (note.length === 3) {
var extend = Object.getOwnPropertyNames ?
function ecma5extend(obj) {
var proto = obj;
var protos = [];
var result = {};
while (proto) {
protos.push(proto);
proto = Object.getPrototypeOf(proto);
}