Building
Pi engine
Section titled “Pi engine”Everything builds in Docker (an image with the AArch64 toolchain and Circle).
pi/circle/build.sh # once: the image and Circle with our USB patchespi/engine/build.sh # once: the engine's Circle tree, the engines' sources, the kernelpi/engine/build.sh kernel # after a change: the kernel only -> pi/engine/kernel8-rpi4.img- The kernel links Circle (GPLv3), so the image is distributed under the GPLv3 as a whole.
- Build options:
PI_IP,PI_NETMASK(the Ethernet defaults),EMUHOST(the emulator host),GADGET(the USB-C device),SIDECAR_CH_IN(12 or 20 computer channels),SIDECAR_NAME(the USB name). - Development flashing goes through Circle’s serial bootloader into RAM (
pi/circle/flash.sh);pi/circle/sdboot.py installwrites a build to the card asengine.img, checked and with the previous one kept. - The SD card file set for a release:
scripts/package_pi.sh <checkout> <commit>in this repository.
Teensy firmware
Section titled “Teensy firmware”Arduino CLI with Teensyduino, -O2:
RMP_EXTRA_FLAGS="-DRYTM_USB_HOST=1" teensy/run_sketch.sh voiceloop # the host build: compile, upload, serial logteensy/host_stereo.sh # the Sidecar Mini release build: USB host + stereo USB audio + USB MIDIteensy/host_uac2.sh # the 20 in / 12 out USB audio build (in development)teensy/gate.sh quick|full # sizes, golden renders, end-to-end checks-DRYTM_PLUGINS=0builds without the machine plugins;-DRYTM_NOTES=1 -DRYTM_OUT_MAIN=1boots for a stock Rytm.run_sketch.shcopiescore/into a generated Arduino library on every build and fails a build that grows ITCM or shrinks the stack past its limits.- The release
.hex(compile only, never uploads):scripts/package_teensy.sh <checkout> <commit>in this repository. It builds withhost_stereo.sh’s flags by default (BUILD=hostfor the plain host build) and takestools/release/teensy_hex.shfrom the engine’srelease-packagingbranch when the commit has none.
Version
Section titled “Version”The VERSION file at the engine’s root (0.1.0) is the only source of the version; tools/gen_version.sh writes it, with the short commit and a dirty flag, into the generated core/version.h on every build (Mac, Pi and Teensy). See Versioning.
Rytm mods
Section titled “Rytm mods”Python 3.11+, m68k-elf-binutils, and your own stock OS 1.73 file in stock/ (the build refuses any other).
make setup # venv and the vendored tools at their pinned commits.venv/bin/python tools/build.py --tag <tag> --mods <mods...> --param ....venv/bin/python tools/verify.py --tag <tag> # re-check every claim and guard against the imagebuild.pychecks the layout and every expected stock byte, assembles the mods and hands the result to elekloader.verify.pyasserts that the other firmware sections are byte-identical to stock.- Read the whole build output: a failed build can leave an older image in place.
tools/release_patch.pyturns a build into a patch file for the patcher, refusing unless the records rebuild the image byte for byte and carry no stock bytes. In this repository:scripts/make_patches.pyandscripts/test_patcher.sh.
This site
Section titled “This site”Node 22.12 or newer (pinned: .nvmrc), packages pinned in package-lock.json:
npm cinpm run dev # local preview at http://localhost:4321/sidecar-expander/npm run build # the static site in _site/, internal links checkedThe patcher and the web console are static files in public/patcher/ and public/console/, served at /patcher/ and /console/. scripts/sync_console.sh updates the console from the engine repository.