mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-17 00:58:09 +00:00
36 lines
No EOL
762 B
HTML
36 lines
No EOL
762 B
HTML
<html>
|
|
<head>
|
|
<title>LFO</title>
|
|
|
|
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
|
|
<script type="text/javascript" src="../Tone.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="exampleStyle.css">
|
|
|
|
</head>
|
|
<body>
|
|
<div>LFO on the amplitude of a noise signal</div>
|
|
<br>
|
|
<button>start</button>
|
|
<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);
|
|
|
|
$("button").click(function(){
|
|
if (noise.state !== "started"){
|
|
lfo.start();
|
|
noise.start();
|
|
$(this).text("stop");
|
|
} else {
|
|
lfo.stop();
|
|
noise.stop();
|
|
$(this).text("start");
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |