Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta charset="utf-8" />


   <div id="target"></div>
    <script src="sketch.js"></script>



                html, body {
  margin: 0;
  padding: 0;


                /* PDM Course: Sound Unit


function setup() {
  //make an autofilter to shape the noise

  //initialize the noise and start
  var noises = [];
  var filters = [];
  var totalSynths = 8
  // create multiple autofilters and connect to multiple synths
  // we do this so we can independantly control the rate of each filter
  for (var i = 0; i < totalSynths; i++) {
    filters[i] = new Tone.AutoFilter({
      frequency: "8m",
      min: 100,
      max: 15000,
      type: "triangle",
      filter: {
        type: "bandpass",
        gain: 12,
        rolloff: -48,
        Q: 15

    noises[i] = new Tone.NoiseSynth({
      type: 'pink',
      "envelope": {
        "attack": 3,
        "decay": 2,
        "sustain": 1,
        "release": 3

  start = createButton("start").mousePressed(() => {
    // iterate over noises and fitlers to trigger
    for(var i = 0; i < totalSynths; i++) {
      // trigger noise
      noises[i].triggerAttackRelease("8m", `+${i}`);
      // start auto filters
      // ramp rate of autofilter
      // set quality of filter over time
      filters[i].filter.Q.setValueCurveAtTime([10, 15, 9, 1], '', '8m')
      // set overall volume of sound over time
      noises[i].volume.setValueCurveAtTime([-30, -6, -10 ], '', '8m')