Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
/ adlib.js Public archive

A prototype reference implementation of Web MIDI API

License

Notifications You must be signed in to change notification settings

marcoscaceres/adlib.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adlib.js

Prototype reference implementaiton of W3C Web MIDI API .

Warning

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.

Getting Started

In the browser

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>

Documentation

W3C Web MIDI API

Examples

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>

Contributing

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!

Release History

(Nothing yet)

License

Copyright (c) 2013 Marcos Caceres
Licensed under the MIT license.

About

A prototype reference implementation of Web MIDI API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published