Tone.js/examples/lfo.html

36 lines
762 B
HTML
Raw Normal View History

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
<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>
<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>
<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">
//components
var noise = new Tone.Noise("brown");
var lfo = new Tone.LFO(1, 0.5, 1);
//connections
noise.toMaster();
lfo.connect(noise.output.gain);
2014-04-06 00:47:59 +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();
$(this).text("stop");
} else {
lfo.stop();
2014-06-21 19:54:20 +00:00
noise.stop();
$(this).text("start");
}
});
2014-03-15 03:17:18 +00:00
</script>
</body>
</html>