What's New in Circuitry 2.1

Circuitry 2.1 is about programs you can hear and play with. A drawing program in JavaScript or Python can now make sound, put dials and a piano keyboard on itself, and be made of several scenes. This page says what is new and where to read about each part.

Everything here works in the preview beside your code, with nothing to install and nothing to import in JavaScript.

Sound and music

A scene can play game sounds, notes and tunes, synths you shape yourself, samples, and whole tracker songs. It is one line to begin with:

function onMouseDown() {
  playSound("coin")
}

On an iPad and an iPhone, the app now makes a scene's sound itself, on the device's own audio thread: a busy scene cannot make it click, and no first tap is needed. See In the iPad and iPhone app.

The microphone, recording your voice and MIDI keyboards are in the library and are not connected in Circuitry's own preview yet. They work on a web page of your own.

Dials, sliders and a keyboard

A scene can put controls on itself. You say what you want and it appears, sized for the screen and for fingers.

const lead = makeSynth("lead")
dial("cutoff", lead, "cutoff")
scope(lead)
keyboard(lead)

Scenes

A program can be several scenes: a title screen, the game and a game-over screen, or the parts of a show on a timer, with a crossfade, a wipe or a slide between them and a scrubber to move through them.

Effects

Glow, trails, a kaleidoscope, old screens, rain and ninety more, done by the graphics card to whatever your scene draws. One line turns one on, and they can move to the music.

Sheet music

A scene can write music out as notes on a staff, play it, and light each note as it sounds. You give it a tune in one line, and you can play along on a keyboard and see which notes were right.

const page = showNotes("E4 D4 C4 D4 E4 E4 E4:2", "quarter", { title: "Mary had a little lamb" })

function onMouseDown() {
  page.play()
}

A video with its sound

Record Video now records a scene with its sound, in JavaScript and in Python, in one MP4 file, exactly in step with the pictures: every frame at its exact time and every note on its frame. Record a scene twice and the two videos are the same. A JavaScript scene that plays a song can end its video when the song ends.

Recipes

Small, whole programs to copy and change, each in JavaScript and in Python: drums, a bass, a tune, a starfield, a scroller, a joystick, a whole small game. They are the recipes Circuitry's own assistant works from, so asking it for one of these things gives you a program that is known to run.

A music tracker (early preview)

A tracker is an editor for songs: a grid of notes in rows and channels, played by the same sound engine a scene uses. It is an early preview, and it is off until you turn it on: Settings, General, Music tracker (early preview).

Where to look things up