Created
April 3, 2014 04:56
-
-
Save mikemunsie/9948473 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
var bpm = 600; | |
var riff1 = "G M G R R G M G R R G G GGG M G R R G M G R R G G GG"; | |
var riff2 = "G M G R L L L L L LLLLRLLLLLLLG M G R L L L L L LLLLRLG G GG"; | |
var track = riff1 + riff2 + riff2 + riff1; | |
/** HERE BE DRONES */ | |
var $window = $(window); | |
var index = 0; | |
track = track.split(""); | |
var playNext = function() { | |
var char = track.shift().charCodeAt(0); | |
if (char != 32) { | |
try { | |
$window.trigger(jQuery.Event('keydown', { which: char, keyCode: char })); | |
} catch(e) {} | |
} | |
if (track.length) { | |
setTimeout(playNext, 60000 / bpm); | |
} | |
}; | |
playNext(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment