Prototype reference implementaiton of W3C Web MIDI API .
This is an unsupported component with an indefinite lifetime. This should be used for evaluation purposes only and should not be used for production level applications.
Download the production version or the development version.
In your web page:
<script src="libs/require.js"></script>
<script src="dist/adlib.min.js"></script>
Play a note on an output.
<script>
function success(access){
//we have access, lets play
var output = access.getOutputs()[0];
if(output){
output.send([0x91, 0x40, 0x5f]);
output.send([0x91, 0x40, 0x0], performance.now() + 200);
return;
}
//otherwise, no outputs :(
fail(new Error("no MIDI outputs"));
}
function fail(e){
console.log("something went wrong: " + e)
}
window.navigator.requestMIDIAccess(success, fail);
</script>
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!
(Nothing yet)
Copyright (c) 2013 Marcos Caceres
Licensed under the MIT license.