Write a Piece#
Each "piece" on AC is coordinated by a single .mjs (JavaScript module) or
.lisp (a custom dialect[0]) file.
This follows Processing's "sketchbook"[1] based development model of one source file per explorable idea, and the Unix philosophy's pattern of offering user-level composability across small single-purpose programs.
-
Drag & Drop
- Enter
sourceto download a bare bonesblank.mjspiece template.
(Or prefix any existing piece withsourceto fork, likesource notepat.) - Open the piece template in a text editor and change
wipe("gray")->wipe("blue"). - Save the file and drag it into the AC window to run it and preview the change.
- Press the piece name in the top left corner to return to
prompt. - Enter
publish[2] to put the code online.
- Enter
-
VS Code
- Enter
editto install the AC VS Code extension. - Press the rectangular AC prompt icon in the VS Code sidebar to open the AC panel.
- Enter
sourceto open a blank JavaScript piece template in the VS Code editor. - Save the template to run it in the AC panel.
- Press the command name in the top left corner to return to
prompt. - Enter
publish[2] to put the code online.
- Enter
-
Testing
For instant multi-device testing in studios and classrooms, AC uses a simple
channelfeature to broadcast incremental changes during piece development.- Enter
channel custom-namereplacingcustom-namewith something unique on the primary development device. - Enter the same command
channel custom-nameon any additional test device. - Drag & Drop piece code to AC or save the file in VS Code to update all devices.
- Enter
[0] "Kid Lisp" source & samples: https://github.com/whistlegraph/aesthetic-computer/blob/main/system/public/aesthetic.computer/lib/kidlisp.mjs
[1] Processing Foundation homepage: https://processing.org
[2] Published pieces by anonymous users are temporarily uploaded to a global
namespace using a short random identifier. Registered users publish under
their @handle where the filename is used for the piece name, or can be
overridden with publish piece-name-here. Find published pieces by other
handles by entering list @handle.