TSW Tremolo

In this example below you will see how to do a TSW Tremolo with some HTML / CSS and Javascript

How to add tremolo to an oscillator using Theresa's Sound World.

Thumbnail
This awesome code was written by stuartmemo, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright stuartmemo ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>TSW Tremolo</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  <link rel='stylesheet prefetch' href='https://stuartmemo.com/codepen/codepen.css'>

  
  
</head>

<body>

  <div class="content">
  <button onclick="runTremoloExample()">Run tremolo example</button> 
</div>
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://theresassoundworld.com/scripts/tsw.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/stuartmemo/tsw-tremolo-Gakjx */
var runTremoloExample = function () {
  var osc = tsw.osc(),
      tremolo = tsw.tremolo();
  
  tsw.connect(osc, tsw.speakers);
  tsw.connect(tremolo, osc);
  
  osc.start();
  tremolo.start();
  
  osc.stop(tsw.now() + 3);
  tremolo.stop(tsw.now() + 3);
};

Comments