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.




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


                /* PDM Course: Sound Unit

Example of Tone.js Reverb Effect

Code by Anthony T. Marasco [2018]

let player;

let reverb;
let button;
let roomSlider;
let wetMix;

let baseURL = "";

/*Here is where we build our audio effect, and connect its output directly to the master output */
reverb = new Tone.JCReverb({
  roomSize: 0.8,
  wet: 0.5

/* Here is where we build our Samplers and connect their outputs to the input of the audio effect. We do this using the .connect() method, and passing in the variable name of the effect we want to connect to*/

player = new Tone.Player(
  baseURL + "Rhythmics/60+bpm/Ping+Pong+Ping.mp3"

function setup() {
  createCanvas(windowWidth, windowHeight);

  wetMix = createSlider(0, 1, 1, 0);"width", "200px");
  wetMix.position(width / 2 - 100, height / 2 + 80);

  roomSlider = createSlider(0, 1, 0.5, 0);"width", "200px");
  roomSlider.position(width / 2 - 100, height / 2 + 170);

  button = createButton("Play Sound");
  button.position(width / 2 - 50, height / 2);

function draw() {
  /*Avoiding putting any sound triggering functions in draw() for this example

  reverb.wet.value = wetMix.value();
  reverb.roomSize.value = roomSlider.value();
  background(92, 173, 191);
  text("Reverb Example", width / 2, height / 2 - 100);

    int(wetMix.value() * 100) + "% effected sound",
    wetMix.x + 100,
    wetMix.y - 10
    "Room size parameter: " + roomSlider.value().toFixed(2) + "%",
    roomSlider.x + 100,
    roomSlider.y - 20

function play1() {