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.


Auto Save

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.


                <h1>Minimal Elementary Starting Template</h1>
<p>To get started, edit the code in the JavaScript pane. To hear the default output of
  the starting template, hit start</p>
<button id="clickMe">Start</button>




                // Welcome to the starting template! Follow along with the comments below
// to get a brief sense of working with Elementary. Documentation is available
// here:
import {ElementaryWebAudioRenderer as core, el} from '';

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

// After we've imported and set up our context, we install a load event listener
// so that once the audio backend is ready we can kick off our render
core.on('load', function() {
  // Before actually rendering anything we put a click handler on the button so that
  // this example doesn't start making noise automatically
  document.getElementById('clickMe').addEventListener('click', async function(e) {
    if (ctx.state === 'suspended') {
      await ctx.resume();

    // Finally we render a tiny arpeggio example with sine tones. Start here
    // to remix and explore Elementary!
    let arp = [1, 5, 7, 8, 10, 12, 8, 7, 5].map(x => 440 * Math.pow(2, (x - 1) / 12));
    let env = el.adsr(0.008, 0.25, 0, 0, el.train(7));

      el.mul(0.25, env, el.cycle(el.seq({seq: arp}, el.train(7)))),
      el.mul(0.25, env, el.cycle(el.seq({seq: arp}, el.train(7)))),

// After installing our load event handler, we initialize the core renderer
// which will spin up the audio backend with the web audio context and fire
// our load event above when ready.
(async function main() {
  let node = await core.initialize(ctx, {
    numberOfInputs: 0,
    numberOfOutputs: 1,
    outputChannelCount: [2],