mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 16:17:58 +00:00
21 lines
No EOL
513 B
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> |