4,264 hits · 11 samples loaded · most struck: pad 2 (Kick Bricks)
A shared 4×4 grid of sample pads, like an MPC. Drop any sound from your computer onto a pad and everyone can play it.
What fold does here
Each pad's sample is stored in fold with who loaded it, when, and a version. Every load and every hit is an event. Hits per player, hits per pad, loads per player and each player's remaining loads are views.
Fold enforces the rules: samples only as short, clean audio of at most four seconds; only pads 1 to 16; hits only on pads that have a sample (a foreign key); and four loads each, refilling one every 15 seconds.
Why it shows off fold
Its rules show fold guarding a shared space with no locking code. A hit on an empty pad, or a fifth load in a hurry, is refused by the database itself, all or nothing, however many people act at once. Loads and hits are pushed from fold subscriptions, so when someone drops a new sound on a pad, every open page fetches it straight away and the next hit plays without delay.
Worth trying
- Drag an audio file onto a pad, then play it from another window.
- Load over someone else's pad: the newest sample wins.
- Load four samples quickly and watch the fifth get refused, then the chip refill.
Still app code
Each browser decodes and tidies your file before uploading it, and the server checks the audio's format itself. Playing samples is your browser's job.
Press \ in the app to watch fold's commits as they happen.