2014-03-19 21:25:33 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-04-06 00:47:59 +00:00
|
|
|
<title>TRANSPORT</title>
|
2014-03-19 21:25:33 +00:00
|
|
|
|
|
|
|
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
|
2014-04-06 00:47:59 +00:00
|
|
|
<script type="text/javascript" src="../deps/require.js"></script>
|
2014-03-19 21:25:33 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-04-06 00:47:59 +00:00
|
|
|
<button>start</button>
|
|
|
|
<div id="output"></div>
|
2014-03-19 21:25:33 +00:00
|
|
|
<script type="text/javascript">
|
2014-04-06 00:47:59 +00:00
|
|
|
require.config({
|
2014-04-06 20:51:30 +00:00
|
|
|
baseUrl : "../"
|
2014-04-06 00:47:59 +00:00
|
|
|
});
|
2014-03-19 21:25:33 +00:00
|
|
|
|
2014-04-06 20:51:30 +00:00
|
|
|
require(["Tone/core/Tone", "Tone/core/Master", "Tone/core/Transport", "Tone/source/Player"], function(Tone){
|
2014-04-06 00:47:59 +00:00
|
|
|
|
|
|
|
var transport = new Tone.Transport(60, 4);
|
2014-03-20 03:59:38 +00:00
|
|
|
|
2014-04-06 00:47:59 +00:00
|
|
|
transport.loop = true;
|
2014-03-20 03:59:38 +00:00
|
|
|
|
2014-04-06 00:47:59 +00:00
|
|
|
var player = new Tone.Player("../audio/505/hh.mp3");
|
|
|
|
player.toMaster();
|
|
|
|
player.load();
|
2014-03-19 21:25:33 +00:00
|
|
|
|
2014-04-06 00:47:59 +00:00
|
|
|
transport.setTimeout(function(time){
|
|
|
|
player.start(time);
|
|
|
|
$("#output").html("a");
|
|
|
|
}, "0:0");
|
2014-03-19 21:25:33 +00:00
|
|
|
|
2014-04-06 00:47:59 +00:00
|
|
|
transport.setTimeout(function(time){
|
|
|
|
player.start(time);
|
|
|
|
$("#output").html("series");
|
|
|
|
}, "0:1");
|
2014-03-19 21:25:33 +00:00
|
|
|
|
2014-04-06 00:47:59 +00:00
|
|
|
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);
|
|
|
|
})
|
|
|
|
});
|
2014-03-19 21:25:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|