mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
66 lines
No EOL
1.4 KiB
HTML
66 lines
No EOL
1.4 KiB
HTML
<html>
|
|
<head>
|
|
<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="../Tone.js"></script>
|
|
<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">
|
|
|
|
</head>
|
|
<body>
|
|
<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>
|
|
<script type="text/javascript">
|
|
|
|
/* globals Tone, GUI */
|
|
|
|
var player = new Tone.Player("./audio/casio/A1.mp3", function(){
|
|
$("#Loading").remove();
|
|
});
|
|
|
|
player.loop = true;
|
|
player.loopStart = 0.1;
|
|
player.loopEnd = 0.11;
|
|
|
|
//connect it to the output
|
|
player.toMaster();
|
|
|
|
// GUI //
|
|
|
|
new GUI.StartButton(Tone.startMobile);
|
|
new GUI.TopBar(Tone);
|
|
|
|
new GUI.Momentary($("#Content"), function(on){
|
|
if (on){
|
|
player.start();
|
|
} else {
|
|
player.stop();
|
|
}
|
|
}, "start", "stop");
|
|
|
|
</script>
|
|
<style type="text/css">
|
|
#Content {
|
|
width: 100px;
|
|
height: 50px;
|
|
}
|
|
.Momentary {
|
|
width: 100%;
|
|
}
|
|
</style>
|
|
</body>
|
|
</html> |