Tone.js/examples/player.html

66 lines
1.4 KiB
HTML
Raw Normal View History

2014-03-15 03:17:18 +00:00
<html>
<head>
2014-09-04 04:06:01 +00:00
<title>PLAYER</title>
<script type="text/javascript" src="./deps/jquery.min.js"></script>
<script type="text/javascript" src="./deps/jquery-ui.js"></script>
<script type="text/javascript" src="./deps/jquery.ui.touch-punch.js"></script>
<script type="text/javascript" src="../build/Tone.js"></script>
2014-09-04 04:06:01 +00:00
<script type="text/javascript" src="./Widgets.js"></script>
<script type="text/javascript" src="./ExampleList.js"></script>
<link rel="stylesheet" type="text/css" href="./style/widgets.css">
<link rel="stylesheet" type="text/css" href="./style/jquery-ui.css">
2014-03-15 03:17:18 +00:00
</head>
<body>
2014-09-04 04:06:01 +00:00
<div id="Container">
<div id="Explanation">
Player
<br>
<br>
Press and hold to hear a 10ms grain of audio.
</div>
<div id="Content">
<div id="Loading">Loading...</div>
</div>
</div>
2014-03-15 03:17:18 +00:00
<script type="text/javascript">
2014-04-06 00:47:59 +00:00
2014-09-04 04:06:01 +00:00
/* globals Tone, GUI */
2014-06-21 22:39:01 +00:00
var player = new Tone.Player("./audio/casio/A1.mp3", function(){
2014-09-04 04:06:01 +00:00
$("#Loading").remove();
2014-06-21 22:39:01 +00:00
});
2014-04-06 00:47:59 +00:00
player.loop = true;
player.loopStart = 0.1;
player.loopEnd = 0.11;
//connect it to the output
player.toMaster();
2014-09-04 04:06:01 +00:00
// GUI //
2014-03-15 03:17:18 +00:00
new GUI.MobileStart(Tone.startMobile);
2014-09-04 04:06:01 +00:00
new GUI.TopBar(Tone);
new GUI.Momentary($("#Content"), function(on){
if (on){
player.start();
} else {
player.stop();
}
}, "start", "stop");
2014-06-20 01:48:16 +00:00
2014-03-15 03:17:18 +00:00
</script>
2014-09-04 04:06:01 +00:00
<style type="text/css">
#Content {
width: 100px;
height: 50px;
}
.Momentary {
width: 100%;
}
</style>
2014-03-15 03:17:18 +00:00
</body>
</html>