Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
integ committed Oct 11, 2014
2 parents c969c28 + b1d1002 commit 544a246
Show file tree
Hide file tree
Showing 6 changed files with 2,417 additions and 0 deletions.
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<!-- midi.js package -->
<script src="./MIDI.js/js/MIDI/AudioDetect.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/LoadPlugin.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/Plugin.js" type="text/javascript"></script>
<script src="./MIDI.js/js/MIDI/Player.js" type="text/javascript"></script>
<script src="./MIDI.js/js/Window/DOMLoader.XMLHttp.js" type="text/javascript"></script>
<!-- extras -->
<script src="./MIDI.js/inc/Base64.js" type="text/javascript"></script>
<script src="./MIDI.js/inc/base64binary.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">

window.onload = function () {
MIDI.loadPlugin({
soundfontUrl: "./MIDI.js/soundfont/",
instrument: "acoustic_grand_piano",
callback: function() {
var delay = 0; // play one note every quarter second
var note = 50; // the MIDI note
var velocity = 127; // how hard the note hits
// play the note
MIDI.setVolume(0, 127);
MIDI.noteOn(0, note, velocity, delay);
MIDI.noteOff(0, note, delay + 0.75);
$('body').keydown(function(e) {
MIDI.noteOn(0, e.which, velocity, delay);
MIDI.noteOff(0, e.which, delay + 0.75);
console.log(e.which);
});
}
});
};

</script>
</body>
</html>
Loading

0 comments on commit 544a246

Please sign in to comment.