Tone.js/examples/transport.html
2014-04-05 20:47:59 -04:00

60 lines
No EOL
1.2 KiB
HTML

<html>
<head>
<title>TRANSPORT</title>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="../deps/require.js"></script>
</head>
<body>
<button>start</button>
<div id="output"></div>
<script type="text/javascript">
require.config({
baseUrl : "../src"
});
require(["core/Tone", "core/Master", "component/Transport", "source/Player"], function(Tone){
var transport = new Tone.Transport(60, 4);
transport.loop = true;
var player = new Tone.Player("../audio/505/hh.mp3");
player.toMaster();
player.load();
transport.setTimeout(function(time){
player.start(time);
$("#output").html("a");
}, "0:0");
transport.setTimeout(function(time){
player.start(time);
$("#output").html("series");
}, "0:1");
transport.setTimeout(function(time){
player.start(time);
$("#output").html("of");
}, "0:2");
transport.setTimeout(function(time){
player.start(time);
$("#output").html("timed");
}, 3);
transport.setTimeout(function(time){
player.start(time);
$("#output").html("events");
}, "0:3:2");
$("button").click(function(){
transport.start(0);
})
});
</script>
</body>
</html>