Tone.js/examples/require.html
Uzerus e32f4b58cb JS type attribute not needed in html5 (#214)
* type attribute not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type at not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not needed

* type att not neede

* type att not needed

* type att not needed

* type att not needed

* type att not needed
2017-03-18 12:35:37 -04:00

49 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MODULE LOADERS</title>
<script src="./scripts/StartAudioContext.js"></script>
<script src="./scripts/require.js"></script>
<script src="./scripts/jquery.min.js"></script>
<script src="./scripts/Interface.js"></script>
<link rel="stylesheet" type="text/css" href="./style/examples.css">
</head>
<body>
<div id="Content" class="FullScreen">
<div id="Title">Module Loaders</div>
<div id="Explanation">
<a href="http://requirejs.org/" target="_blank">RequireJS</a>
is a powerful module and build system which Tone.js uses internally.
By only including the modules that your application needs, your build can be
much smaller and your code much more modular.
<br><br>
If you use RequireJS (or any other UMD module loader), but build-size is less of a concern,
you can simply include the entire Tone.js build.
<br><br>
Take a look at the source to see how.
</div>
</div>
<script>
require.config({
baseUrl : "./",
//make a path to the Tone.js/Tone directory
//then include the sources as they are below
paths : {
"Tone" : "../Tone",
}
});
require(["Tone/core/Master", "Tone/instrument/Synth"],
function(Master, Synth){
var synth = new Synth().toMaster();
synth.triggerAttackRelease("C4", "8n");
});
</script>
</body>
</html>