livecoder.net icon indicating copy to clipboard operation
livecoder.net copied to clipboard

A simple browser environment for coding live javascript.

LiveCoder.net = A simple browser environment for coding live javascript

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 error(-)

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 mouseY

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) middleC

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