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")
}- Sound and music: start here, with fourteen game sounds.
- Notes, chords and tunes, as text or as code, in time with a tempo.
- Synths and their settings: nineteen ready-made ones, and every one can be changed.
- Effects: echo, chorus, a reverb that is a room, a hall, a plate, a cathedral or a spring, and a trance gate that chops a held chord into a rhythm.
- Bending a note: a slide into a note, a scoop, a fall and a vibrato.
- Samples: a recorded sound as an instrument, and an instrument made from several recordings.
- Chip sounds and arpeggios: the chords and drums of a home computer, and arpeggios in time with the tempo too: a trance arpeggio is one line.
- Songs:
.modand.xmfiles, songs written in the program, and a mix with a fader for each channel. - A sound button:
soundButton()puts a speaker on a scene to switch its sound off and on, andaskAboutSound()lets a demo ask first. - If sound clicks or stutters.
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)- Dials: start here, and every control.
- Numbers, text and choices: a number box, a text box, a checkbox, a dropdown, a colour picker.
- Controls for a game: a joystick and a pad of arrows for a phone.
- Controls for music: pads, a grid of steps, editors for a synth's trance gate and its arpeggio pattern with the sounding step lit, and a drum sequencer in one line.
- Laying out a panel: groups, grids and pages, and a panel that fits a phone.
- Tying a control to a synth.
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.
- Effects: start here, in JavaScript and in Python.
- Every effect, each with its picture and its settings, and the ready-made looks.
- Moving to the music, and a shader of your own.
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()
}- Sheet music: start here, and what you can show.
- Playing and following, playing along, and a song as sheet music.
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.
- A video with its sound: how, what is in it, and where it has been tried.
- Record a video for a JavaScript scene.
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
- The pictures.js function index and the Pyctures function index have every new name, by area.
- The synths function index has every sound name in both spellings.