2014-03-15 03:17:18 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-03-15 03:30:00 +00:00
|
|
|
<title>LFO</title>
|
2014-03-15 03:17:18 +00:00
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
|
2014-06-21 19:54:20 +00:00
|
|
|
<script type="text/javascript" src="../Tone.js"></script>
|
2014-06-23 17:29:22 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="exampleStyle.css">
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-03-15 03:17:18 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-06-23 17:29:22 +00:00
|
|
|
<div>LFO on the amplitude of a noise signal</div>
|
|
|
|
<br>
|
|
|
|
<button>start</button>
|
2014-03-15 03:17:18 +00:00
|
|
|
<script type="text/javascript">
|
2014-04-16 00:05:11 +00:00
|
|
|
//components
|
|
|
|
var noise = new Tone.Noise("brown");
|
2014-06-23 17:29:22 +00:00
|
|
|
var lfo = new Tone.LFO(1, 0.5, 1);
|
2014-04-16 00:05:11 +00:00
|
|
|
|
|
|
|
//connections
|
|
|
|
noise.toMaster();
|
|
|
|
lfo.connect(noise.output.gain);
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
$("button").click(function(){
|
|
|
|
if (noise.state !== "started"){
|
2014-04-06 00:47:59 +00:00
|
|
|
lfo.start();
|
2014-06-21 19:54:20 +00:00
|
|
|
noise.start();
|
2014-06-23 17:29:22 +00:00
|
|
|
$(this).text("stop");
|
2014-04-16 00:05:11 +00:00
|
|
|
} else {
|
|
|
|
lfo.stop();
|
2014-06-21 19:54:20 +00:00
|
|
|
noise.stop();
|
2014-06-23 17:29:22 +00:00
|
|
|
$(this).text("start");
|
2014-04-16 00:05:11 +00:00
|
|
|
}
|
2014-06-23 17:29:22 +00:00
|
|
|
});
|
2014-03-15 03:17:18 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|