Share this link:

Embed this HTML:

Copied to clipboard!  =  A simple browser environment           Request a feature
                  for coding live javascript             Fork me on github
                                                              Report a bug
Language Extensions

  vars._        A place to put persistent data
  once._        A place to put functions that run once
  always._      A place to put functions that run continuously

  cached(f)(-)  Caches value of f applied to JSON'able arguments
                (useful for expensive tasks like audio synthesis)

  clear()       Clears vars, once, always, cache, setTimeouts, canvas

  using(url)    Loads & caches a remote script (useful for libraries)

Coding Tools

  help(-)       Looks inside any object/function (great for hacking :)

  print(-),     Print messages to log area

  assert(-,-)   assert(value,message) throws an error if value is false
                (see help(assert) for details & other assertions)

  TODO(-)       TODO(message) is a placeholder for unfinished code

Graphics - using HTML5 canvas

  draw          A 2D canvas context (see examples)

  mouseX,       Current mouse coordinates in pixels

Audio - using HTML5 audio

  play(-)       Plays a uri from encodeWav/tone/noise/speech or the web

  encodeWav(-)  Encodes an array of [-1,1]-valued samples to a wav uri

  tone(-),      Synthesize sound and encode to wav uri
  noise(-)      (see examples or try help(-) for details)

  sampleRate,   Constants in kHz (all time units are ms or kHz)

Speech - using espeak/speak.js

  using('speech.js'); // load speech library first

  say(text)     Speaks text out loud

  speech(text)  Synthesizes voice and encodes to a wav uri

Keyboard Shortcuts

  F1            Show language help              F1
  F2            Show keyboard shortcuts         F2

  Ctrl-C        Reset state, same as clear()    Cmd-C
  Escape        Pause/continue compiling        Escape
                (useful for atomic edits)

  Ctrl-F        Start searching                 Cmd-F
  Ctrl-G        Find next                       Cmd-G
  Shift-Ctrl-G  Find previous                   Shift-Cmd-G
  Shift-Ctrl-F  Replace                         Cmd-Option-F
  Shift-Ctrl-R  Replace all                     Shift-Cmd-Option-F

  Ctrl-Space    Autocomplete                    Cmd-Space

  Ctrl-S        Save code locally               Cmd-S
  Ctrl-O        Open local gallery              Cmd-O


Related Projects

    an organization dedicated to live coding of art

    a live coding IDE for video and audio

  GLSL sandbox
    mrdoob's live coding environment for GLSL in the browser
    (with community gallery & forking)

  Studio Sketchpad
    a browser-based IDE for processing.js

  Lively Kernel
    an early experiment in browser-as-platform

    a band of visual live coders
    who converted some of their material to webgl

  mrdoob's voxels
    a WebGL demo of MineCraft-style block building

    a programming langauge with javascript semantics but cleaner syntax
    (compiles to javascript in a browser)

    a programming language that cleans up and compiles to javascript

    a javascript live-coding framework developed with openframeworks

    a browser-based collaborative code editor using Eclipse Orion
    (also called livecoder)

    a vector graphics library with a sexy demo

    a voice synthesizer running in javascript (even on chrome)
    a javascript style beautifier (including lexer)

    a browser-based playground for learning HTML5 and javascript

  html5wow terminal
    a browser-based terminal emulator

  ...many others...