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-21 19:54:20 +00:00
|
|
|
<script type="text/javascript" src="../Tone.js"></script>
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-03-15 03:17:18 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-04-16 00:05:11 +00:00
|
|
|
<button onclick='startLFO()'>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");
|
|
|
|
var lfo = new Tone.LFO("4n");
|
|
|
|
|
|
|
|
//connections
|
|
|
|
noise.toMaster();
|
|
|
|
lfo.connect(noise.output.gain);
|
|
|
|
|
|
|
|
//INTERFACE//
|
|
|
|
var button = document.querySelector("button");
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
var started = false;
|
2014-04-06 00:47:59 +00:00
|
|
|
|
2014-04-16 00:05:11 +00:00
|
|
|
//called when the start button is clicked
|
|
|
|
function startLFO(){
|
|
|
|
if (!started){
|
2014-04-06 00:47:59 +00:00
|
|
|
lfo.start();
|
2014-06-21 19:54:20 +00:00
|
|
|
noise.start();
|
2014-04-16 00:05:11 +00:00
|
|
|
button.textContent = "stop";
|
|
|
|
} else {
|
|
|
|
lfo.stop();
|
2014-06-21 19:54:20 +00:00
|
|
|
noise.stop();
|
2014-04-16 00:05:11 +00:00
|
|
|
button.textContent = "start";
|
|
|
|
}
|
|
|
|
started = !started;
|
|
|
|
}
|
2014-03-15 03:17:18 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|