Tone.js/examples/envelope.html

21 lines
No EOL
513 B
HTML

<html>
<head>
<title>Envelope</title>
<script type="text/javascript" src="../build/Tone.js"></script>
</head>
<body>
<button onmousedown='env.triggerAttack()' onmouseup='env.triggerRelease()' id='Trigger'>trigger</button>
<script type="text/javascript">
</script>
<script type="text/javascript">
var env = new Tone.Envelope(.05, .01, .7, .4);
var noise = new Tone.Noise();
//connect the evnelope to the output gain
noise.toMaster();
env.connect(noise.output.gain);
</script>
</body>
</html>