Zum Inhalt

physarum

Pure ambient generative art — a stigmergy simulation in WebGPU.

License: AGPL-3.0 Latest release Built with WebGPU On the App Store

Physarum simulates Physarum polycephalum (slime mold) — thousands of agents follow chemical trails, forming organic, ever-shifting path networks. It runs as a web app, a native macOS app, and native apps for iPhone, iPad, and Apple TV. Watch, tune, record, share.

Physarum — Mystic preset

Download for macOS    Launch the web app

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.

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.
  • 7 curated factory presets — Aurora, Mandala, Mystic, Terminal Haze, Neon Waves, Solar Veil, and Dancing Ink: a hand-tuned starting set spanning luminous rings, kaleidoscopic symmetry, and ink-on-paper.
  • 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.

The curated factory set — seven hand-tuned presets that ship as the starting slots in the native apps (new in v2.1.0). Click any preset for a live, full-window demo (then the ⛶ button for true fullscreen). These 7 are the full built-in set.

Aurora
Aurora
luminous magenta ring
▶ live demo
Mandala
Mandala
8-fold star kaleidoscope
▶ live demo
Mystic
Mystic
violet chase kaleidoscope
▶ live demo
Terminal Haze
Terminal Haze
phosphor-green kaleidoscope
▶ live demo
Neon Waves
Neon Waves
electric neon ribbons
▶ live demo
Solar Veil
Solar Veil
molten amber veil
▶ live demo
Dancing Ink
Dancing Ink
red ink on paper
▶ live demo

Native apps

Beyond the web app, Physarum ships as native SwiftUI/Metal apps — the same engine, with a full authoring editor, audio-reactivity, and capture on every platform:

  • macOS — download the notarised universal app below (macOS 14+).
  • iPhone, iPad & Apple TV — on the App Store as Physarum Ambient, free. On Apple TV, Physarum becomes a lean-back ambient display you steer from the couch or mirror live from your phone.
Physarum on iPhone
iPhone
Physarum on iPad
iPad

Physarum on Apple TV — ambient mode
Apple TV — ambient mode · ▶ watch a 25 s preview

Embed

Drop the player onto any page with the <physarum-player> custom element:

<script type="module" src="https://pages.jkaindl.de/physarum/physarum-player.js"></script>

<!-- a built-in preset -->
<physarum-player preset="builtin:aurora"></physarum-player>

<!-- your own preset: in the app, open Settings -> "Copy embed code" -->
<physarum-player preset="token:..."></physarum-player>

<!-- a cycling playlist -->
<physarum-player playlist="builtin:aurora,builtin:mandala,builtin:mystic" interval="20"></physarum-player>

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:

<iframe src="https://pages.jkaindl.de/physarum/player.html?preset=builtin:aurora"
        style="border:0;width:100%;height:400px" allowfullscreen allow="fullscreen"></iframe>

Usage

Open the web app, pick a preset from the Library, and watch. Everything else sits in the top bar:

Control What it does
Library the seven built-in presets plus your own saved ones
Editor live parameters — species, sensors, colour, bloom, symmetry; per-section reset and save-as-new
Play / Pause (Space) freezes the simulation without losing its state
Respawn (R) reseeds the agents, keeping the current parameters
Export PNG a still of the current frame
Record captures a video clip
Share a link that carries the preset
Menu audio-reactive setup, capture options, Copy embed code

The simulation starts on load; you never have to configure anything to see it run. Audio-reactive mode asks for microphone or tab-audio permission the first time you enable it in the menu.

Deep links. Both routes accept ?preset=<id> — index.html for the full app, player.html for a bare full-window view (the same one behind every ▶ live demo above):

https://pages.jkaindl.de/physarum/?preset=builtin:mystic
https://pages.jkaindl.de/physarum/player.html?preset=builtin:mystic

For embedding the player in a page of your own, see Embed above.

Requirements

  • Browser with WebGPU support (Chrome/Edge 113+, Safari 26+, Firefox stable)
  • For audio-reactive mode: microphone permission
  • Node 22+ for development

Development

npm install
npm run dev

Visit http://localhost:5173.

Build

npm run build
npm run preview

Testing

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:

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 the pages host Pages by .forgejo/workflows/deploy.yml: https://pages.jkaindl.de/physarum/

macOS app — the native SwiftUI/Metal app (full authoring editor, audio-reactive, capture/export), Developer ID-signed + notarised, universal (Apple Silicon + Intel):

./scripts/build-macos-app.sh   # → dist-macos/Physarum.dmg

See docs/MACOS-APP.md. App icons are generated from assets/icon.svg via ./scripts/gen-icons.sh.

Contributing

Contributions are welcome — see CONTRIBUTING.md. Release history is in CHANGELOG.md.

License

Physarum is dual-licensed:

  • AGPL-3.0-or-later for open-source use — see LICENSE.
  • A commercial license is available for proprietary use that the AGPL doesn't allow — e.g. embedding the <physarum-player> component on a closed-source website or in a SaaS — see LICENSING.md or email code@jkaindl.de.

Contributions are accepted under the Contributor License Agreement.

Support

If Physarum brightens a screen of yours, you can leave a tip on Liberapay. For commercial use, see LICENSING.md.

Quelldateien