https://github.com/johannes-kaindl/physarum
Generative slime-mold art in WebGPU. 19 presets, audio-reactive routing across 10 targets, kaleidoscope, paint/glow blend modes, long-exposure trails. PWA + standalone macOS app.
https://github.com/johannes-kaindl/physarum
creative-coding generative-art simulation slime-mold typescript webgpu
Last synced: 12 days ago
JSON representation
Generative slime-mold art in WebGPU. 19 presets, audio-reactive routing across 10 targets, kaleidoscope, paint/glow blend modes, long-exposure trails. PWA + standalone macOS app.
- Host: GitHub
- URL: https://github.com/johannes-kaindl/physarum
- Owner: johannes-kaindl
- License: agpl-3.0
- Created: 2026-05-30T19:38:25.000Z (28 days ago)
- Default Branch: main
- Last Pushed: 2026-06-13T07:37:33.000Z (15 days ago)
- Last Synced: 2026-06-13T09:22:47.017Z (15 days ago)
- Topics: creative-coding, generative-art, simulation, slime-mold, typescript, webgpu
- Language: Swift
- Homepage: https://jkaindl.codeberg.page/physarum/
- Size: 19.6 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
- Cla: CLA.md
Awesome Lists containing this project
README
# Physarum
> Pure ambient generative art — a stigmergy simulation in WebGPU.
[](LICENSE)
[](https://codeberg.org/jkaindl/physarum/releases/latest)
[](https://codeberg.org/jkaindl/physarum)
A progressive web app that simulates _Physarum polycephalum_ (slime mold).
Thousands of agents follow chemical trails, forming organic, ever-shifting
path networks. Watch, tune, record, share.
macOS app requires macOS 14+ (native Metal, universal) · the web app runs in any WebGPU browser
> **macOS:** the release app is **Developer ID-signed and Apple-notarised**,
> so it launches straight away — no Gatekeeper detour. Background and the
> build/signing details: [`docs/MACOS-APP.md`](docs/MACOS-APP.md).
## Features
- **3-species stigmergy** with a per-pair interaction matrix — each species
reads three pheromone channels and steers via a 3-sensor classical
Physarum (M1) model.
- **25 curated built-in presets** spanning glow-y physarum classics
(Aurora, Lava, Synthwave), tightly-structured tech aesthetics
(Matrix, Circuits, Neural Lattice), kinetic motion (Murmuration, Comet
Trail, Supernova), paint-on-paper sumi-e (Ink Study, Ink Veins) and
meditative symmetry (Mandala, Mandala Six).
- **Live editor** with collapsible sections, per-parameter help
tooltips, per-section reset, and a save-as-new flow with auto-baked
thumbnails.
- **Audio-reactive** — microphone or tab-audio capture, free routing
from bass/mid/high to any of 10 modulation targets (move, turn,
deposit, sensor, rhythm, chaos, exposure, bloom, saturation,
contrast), with auto-gain.
- **Capture** — PNG screenshot, WebM/MP4 video recording, msgpack-
packed `#p=…` share links.
- **Post-processing stack** — HDR feedback echo, threshold bloom,
ACES tonemap, saturation/contrast/vignette grading.
- **Two blend modes** — additive (glow) for dark backgrounds, paint
(ink) for bright ones.
- **Kaleidoscope** (1-6 mirror axes) and **long-exposure head highlight**
for two distinct post-fx looks.
- **Sim-speed multiplier** (1-8×) to evolve patterns faster than
real time.
## Preset gallery
A taste of the 25 built-ins — these six are new in **v1.5.0**:

Neural Lattice
multi-species neon network

Ember Veil
warm dendrite glow

Mandala Six
6-fold kaleidoscope

Ink Veins
paint-mode ink on paper

Aurora Drift
cooperative flowing ribbons

Supernova
center-spawn chaos burst
## Embed
Drop the player onto any page with the `` custom element:
```html
```
Attributes: `preset`, `playlist`, `interval` (seconds), `controls`
(`auto`/`always`/`none`), `poster`, `asset-base`, `autoplay`, `loop`.
JS API: `.play()`, `.pause()`, `.next()`, `.prev()`, `.load(source)`.
Events: `physarum:ready`, `physarum:presetchange`, `physarum:error`.
The player is purely visual (no audio reactivity) and falls back to a poster
image when WebGPU is unavailable. Or embed via iframe using the hosted route:
```html
```
## Requirements
- Browser with WebGPU support (Chrome/Edge 113+, Safari 26+, Firefox stable)
- For audio-reactive mode: microphone permission
- Node 22+ for development
## Development
```bash
npm install
npm run dev
```
Visit `http://localhost:5173`.
## Build
```bash
npm run build
npm run preview
```
## Testing
```bash
npm test # unit tests
npm run test:e2e # end-to-end (Playwright)
npm run lint
npm run typecheck
```
## Preset thumbnails
Built-in preset cards ship with pre-rendered thumbnails in
`public/preset-thumbs/`. After editing a preset's parameters, re-bake:
```bash
npm run dev # in one terminal
npm run bake:thumbnails # in another — opens a headed Chromium
```
Headed mode is required on macOS — Chrome's headless renderer doesn't
expose a working WebGPU device, so headless captures end up blank.
## Distribution
**Web (PWA)** — every push to `main` is built and published to Codeberg
Pages by `.forgejo/workflows/deploy.yml`:
**macOS app** — the native SwiftUI/Metal app (full authoring editor, audio-reactive,
capture/export), Developer ID-signed + notarised, universal (Apple Silicon + Intel):
```bash
./scripts/build-macos-app.sh # → dist-macos/Physarum.dmg
```
See [`docs/MACOS-APP.md`](docs/MACOS-APP.md). App icons are generated from
`assets/icon.svg` via `./scripts/gen-icons.sh`.
## Contributing
Contributions are welcome — see [`CONTRIBUTING.md`](CONTRIBUTING.md).
Release history is in [`CHANGELOG.md`](CHANGELOG.md).
## License
Physarum is **dual-licensed**:
- **AGPL-3.0-or-later** for open-source use — see [`LICENSE`](LICENSE).
- A **commercial license** is available for proprietary use that the AGPL
doesn't allow — e.g. embedding the `` component on a
closed-source website or in a SaaS — see [`LICENSING.md`](LICENSING.md) or
email `code@jkaindl.de`.
Contributions are accepted under the
[Contributor License Agreement](CLA.md).
## Support
If Physarum brightens a screen of yours, you can leave a tip on
[Liberapay](https://liberapay.com/jkaindl). For commercial use, see
[`LICENSING.md`](LICENSING.md).