mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-29 04:53:10 +00:00
34 lines
No EOL
720 B
HTML
34 lines
No EOL
720 B
HTML
<html>
|
|
<head>
|
|
<title>Bit Crush</title>
|
|
|
|
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
|
|
<!--
|
|
<script type="text/javascript" src='../Tone.js'></script>
|
|
-->
|
|
<script type="text/javascript" src="../deps/require.js"></script>
|
|
</head>
|
|
<body>
|
|
<button>start</button>
|
|
<script type="text/javascript">
|
|
require.config({
|
|
baseUrl : "../"
|
|
});
|
|
|
|
require(["Tone/core/Tone", "Tone/core/Master", "Tone/signal/BitCrusher"], function(Tone){
|
|
var sine = Tone.context.createOscillator();
|
|
var crusher = new Tone.BitCrusher(5);
|
|
|
|
sine.connect(crusher);
|
|
crusher.toMaster();
|
|
|
|
$("button").click(function(){
|
|
sine.start(0);
|
|
})
|
|
|
|
window.crusher = crusher;
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html> |