Created
March 28, 2015 17:15
-
-
Save samhains/3eaf0c888f815958f2b2 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
function playNote(note, tempo){ | |
setTimeout(function(){ | |
synth.triggerAttackRelease(note+"4", 0.25); | |
}, tempo); | |
} | |
function Note(note,tempo){ | |
this.note = note; | |
this.tempo = tempo; | |
} | |
var noteArr = [new Note('C4',1000), new Note('D4',1000), new Note('E4',1000) ]; | |
noteArr.forEach(function(noteObj){ | |
var note = noteObj.note; | |
var tempo = noteObj.tempo; | |
playNote(note,tempo); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment