hdslave Machine is an Elektron-style multi-machine synth (FM TONE, drum machines, KIT and more) with its own painted page: a CLAP plug-in for the Akai MPC Sample. It is made to run in hdslaveOS, the hdslave fork of Kerem Kiliç's Melodee. Its CLAP id is com.hdslave.machine, and it builds to build/Machine.clap.
On the author's machine, this repository sits in one folder beside the other hdslave projects. That folder's ../AGENTS.md and ../Workflow/ hold the shared workflow:
- building in the Linux VM;
- what hdslaveOS does to plug-ins;
- screen pages;
- reviews;
- publishing, the hub repository and staging for the SD card.
Read ../AGENTS.md, then ../Workflow/plugins.md and ../Workflow/host-facts.md, before you change anything. The rules below hold either way.
./build.shbuilds the plug-in in a Linux arm64 container (imagemelodee-builder, Colima VMmelodee). It runsmake all test: the host tests intests/host.cppand the sound's fingerprint. Pass make targets to run others (./build.sh sanitizefor ASan + UBSan over the host tests).tools/bench.shcounts the instructions of a 128-frame block with callgrind. A block is about 4.8 M cycles on one of the MPC's Cortex-A55 cores.- Check the build's own exit code:
./build.sh | grep …hides a failure.
- Fixed for saved projects. Parameter ids, preset keys and choice orders never change once released, because saved projects and presets refer to them.
- Add new ones at the end.
- Ranges stay as they are too: the host stores bindings normalized to the range.
- The sound is held to the bit by
tests/fingerprint.txt.- A refactor or speed-up must leave every hash unchanged. With
-ffp-contract=fast, even reshaping a loop can change the last bit, so check after every edit. - Only a change meant to change the sound runs
make fingerprint-update, and its commit says which hashes moved and why.
- A refactor or speed-up must leave every hash unchanged. With
- Real-time and determinism. The output is the same at every block size. No allocation, locks or file I/O on the audio thread.
- Notes must survive how hdslaveOS sends them:
- every MIDI event of a block arrives at frame 0;
- a re-pressed key arrives as on, on, off;
- CC 120 and 123 arrive at 0 on every channel when the host silences.
- Commits are made as
hdslave <[email protected]>, with Conventional Commits. Never push, publish or stage for the card without the owner's word. - Other agents' work. Others may be working here. Check
git statusandgit worktree list, and never edit, commit or reset files you did not change. - Names and art. No trademarked names in the plug-in's names, presets, UI text or art. Art is original; fonts are OFL, with their licences beside them in
assets/fonts/<font>/OFL.txt. - Read the README before you change the sound. It lists the sources, the inferred values and the deliberate deviations. Keep it current: version, costs, and "not yet run on the MPC" until it has been.
- Branches. Engine work happens on branch
engine, which is pushed asmain. The page's art and interface code are designed on branchscreen.screenownsui/,assets/andtools/ui_*.engineownssrc/,tests/, theMakefileandbuild.sh.- Their contract is
ui/machine_ui.h.
- The screen glue is built in when
ui/exists.make UI_DIR=…builds against another copy. - Fixed positions. Machine numbers and KIT slot layouts are positional forever: append only.
- Machine knobs are the fixed slots Data A-J, whose text changes per machine, because hosts don't re-read parameter names.
- A machine change resets Data to that machine's defaults, through output param events.
- The pads.
src/machine.cppembeds Melodee's drum-map JSON (padMapJson, kept bypadsJson()), so hdslaveOS plays the track's pads as keys 36-51 and − / + move the bank. Every incoming key goes throughplayKey()insrc/params.hbefore the engine uses it, note-offs, chokes and CC 84 included. Only KIT maps keys (slot = ((key-36) mod 16) mod 8, every bank the same hit); every other machine plays each key exactly as 0.1.7 did, because a key that already sounded must never change. Keep the map's notes at 36-51. - 139 parameters (35 shared + 8 KIT slots of 13) is not a multiple of three for hdslaveOS's Edit rows. Accepted as it stands: never pad the table with filler parameters to reach one; only real appended parameters may land it on a multiple.
Every release ZIP includes the full repository LICENSE.txt beside the third-party notices, outside signed plug-in bundles. Preserve both when packaging the plug-in for another project.