Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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.


                <button id="clickMe">Start</button>




                import {ElementaryWebAudioRenderer as core, el} from '[email protected]';

const ctx = new (window.AudioContext || window.webkitAudioContext)();

core.on('load', function() {
  document.getElementById('clickMe').addEventListener('click', async function(e) {
    if (ctx.state === 'suspended') {
      await ctx.resume();

    // Step 1: Start with a simple sine tone multiplied by a pluck-like
    // envelope shape.
    let pitch = 555;
    let gate = el.train(2); // el.metro({interval: 250});
    let env = el.adsr(0.01, 0.25, 0.0, 0.0, gate);

      el.mul(el.cycle(pitch), env),
      el.mul(el.cycle(pitch), env),
    // Step 2: We'll move the pitch of the sine tone according to
    // a second envelope, which quickly sweeps down from 4 to 1.
    let pitchenv = el.adsr(0.005, 0.04, 0.0, 0.0, gate);
    let clean = el.mul(
          el.add(1, el.mul(3, pitchenv)),

    // Uncomment here to listen to step 2. And for a final step 3,
    // move the `pitch` value above down into the bass region, near 50Hz.
    // core.render(clean, clean);

(async function main() {
  let node = await core.initialize(ctx, {
    numberOfInputs: 0,
    numberOfOutputs: 1,
    outputChannelCount: [2],