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.

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 ©


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

  <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'>



  <div class="content">
  <button onclick="runTremoloExample()">Run tremolo example</button> 
  <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>



/*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.stop(tsw.now() + 3);
  tremolo.stop(tsw.now() + 3);