| project | type | status | beth_topics | tags | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
morphogen |
software |
active |
|
|
Where computation becomes composition
Morphogen is a universal, deterministic computation platform that unifies domains that have never talked to each other before: audio synthesis meets physics simulation meets circuit design meets geometry meets optimization β all in one type system, one scheduler, one language.
Current tools force you to:
- Export CAD β import to FEA β export mesh β import to CFD β manually couple results
- Write audio DSP in C++ β physics in Python β visualization in JavaScript
- Bridge domains with brittle scripts and incompatible data formats
Morphogen eliminates this fragmentation. Model a guitar string's physics, synthesize its sound, optimize its geometry, and visualize the result β all in the same deterministic execution environment.
Morphogen is a production component of the Semantic Infrastructure Lab (SIL) β building the semantic substrate for intelligent systems.
Role in the Semantic OS:
- Layer 2: Domain Module (audio, physics, circuits, geometry)
- Layer 4: Deterministic Engine (MLIR compilation, reproducible execution)
SIL Principles Applied:
- β Clarity β Explicit domain semantics (audio, field, agent, geometry)
- β Simplicity β Four core operations unify all domains
- β Composability β Domains compose via typed connections
- β Correctness β Type system enforces units, rates, constraints
- β Verifiability β Deterministic execution enables reproducibility
Quick Links: SIL Manifesto β’ Unified Architecture β’ Project Index
Morphogen presents two human-friendly faces powered by a single semantic kernel:
- Morphogen.Audio β Declarative language for compositional audio, physics, and multi-domain scenes
- RiffStack β Live performance environment for real-time interaction and improvisation
Both compile to the same Graph IR, share the same operator registry, and guarantee deterministic, reproducible results.
π Deep Dive: See docs/architecture/ for the complete stack design (kernel, frontends, Graph IR, MLIR compilation)
Cross-Domain Composition
- Audio synthesis + fluid dynamics + circuit simulation in the same program
- Type-safe connections between domains (e.g., field β agent force, geometry β audio impulse response)
- Single execution model handles multiple rates (audio @ 48kHz, control @ 60Hz, physics @ 240Hz)
Deterministic by Design
- Bitwise-identical results across runs, platforms, and GPU vendors
- Explicit RNG seeding, sample-accurate event scheduling
- Three profiles:
strict(bit-exact),repro(deterministic FP),live(low-latency)
Transform-First Thinking
- FFT, STFT, wavelets, DCT as first-class operations
- Domain changes (time β frequency, space β k-space) are core primitives
- Uniform transform API across all domains
Production-Grade Compilation
- MLIR-based compiler with 6 custom dialects
- Lowers to optimized CPU/GPU code via LLVM
- Field operations, agents, audio DSP, temporal execution all compile to native code
Morphogen (software) and Philbrick (hardware) are two halves of one vision β modular computation in different substrates.
| Aspect | Morphogen (Digital) | Philbrick (Analog/Hybrid) |
|---|---|---|
| Purpose | Digital simulation of continuous phenomena | Physical embodiment of continuous dynamics |
| Primitives | Streams, fields, transforms | Sum, integrate, nonlinearity, events |
| Safety | Type system (domain/rate/units) | Pin contracts (voltage/impedance/latency) |
| Execution | Multirate deterministic scheduler | Latency-aware routing fabric |
| Philosophy | Computation = composition | Computation = composition |
- Design in Morphogen β Simulate and optimize continuous-time systems
- Build in Philbrick β Physical modules implementing the same primitives
- Validate Together β Software and hardware mirror each other
Both platforms share the same four core operations (sum, integrate, nonlinearity, events) and the same compositional philosophy. They will eventually compile to each other.
π§ Learn More: Philbrick - Modular analog/digital hybrid computing platform
Here's what sets Morphogen apart β domains working together seamlessly:
# Couple fluid dynamics β acoustics β audio synthesis
use fluid, acoustics, audio
# Simulate airflow in a 2-stroke engine exhaust
@state flow : FluidNetwork1D = engine_exhaust(length=2.5m, diameter=50mm)
@state acoustic : AcousticField1D = waveguide_from_flow(flow)
flow(dt=0.1ms) {
# Fluid dynamics: pressure pulses from engine
flow = flow.advance(engine_pulse(t), method="lax_wendroff")
# Couple to acoustics: flow β sound propagation
acoustic = acoustic.couple_from_fluid(flow, impedance_match=true)
# Synthesize audio from acoustic field
let exhaust_sound = acoustic.to_audio(mic_position=1.5m)
# Real-time output
audio.play(exhaust_sound)
}
One program. Three domains. Zero glue code.
See docs/use-cases/2-stroke-muffler-modeling.md for the complete example.
git clone https://github.com/scottsen/morphogen.git
cd morphogen
pip install -e .Create hello.kairo (Morphogen source files use .kairo extension):
# hello.kairo - Heat diffusion
use field, visual
@state temp : Field2D<f32 [K]> = random_normal(
seed=42,
shape=(128, 128),
mean=300.0,
std=50.0
)
const KAPPA : f32 [mΒ²/s] = 0.1
flow(dt=0.01, steps=500) {
temp = diffuse(temp, rate=KAPPA, dt, iterations=20)
output colorize(temp, palette="fire", min=250.0, max=350.0)
}
Run it:
morphogen run hello.kairoNext steps:
- Try the examples directory (24 working examples)
- Read Getting Started for a guided tutorial
- Explore the domain catalog to see what's possible
Current Status (v0.11.0):
- β
25 active computational domains (fully integrated with
usestatement) - β 15 legacy domains (implemented, migration to new system in progress)
- β 386 operators accessible from Morphogen language
- β 1,381 tests passing (251 MLIR tests skipped)
- β MLIR compilation pipeline complete (6 phases)
- β Python runtime with NumPy backend
v1.0 Release Plan (24 weeks):
Morphogen is on an aggressive path to v1.0 with a three-track strategy:
-
Track 1 - Language Evolution (13 weeks)
- Symbolic + numeric execution (SymPy integration)
- Transform space tracking with functorial translations
- Algebraic composition (
βoperator) + category theory optimization - Domain plugin system for user extensibility
-
Track 2 - Critical Domains (12 weeks)
- Circuit domain with audio coupling β Unique differentiator
- Fluid dynamics (Navier-Stokes)
- Chemistry Phase 2 expansion
- Target: 50+ domains
-
Track 3 - Adoption & Polish (ongoing)
- PyPI release (alpha in week 4)
- 5 showcase examples with videos
- 7 progressive tutorials
- Complete API documentation
- Active community infrastructure
Read the full plan: Morphogen Roadmap
What makes v1.0 special:
- π¬ Symbolic + numeric execution (first platform to combine both)
- π΅ Circuit β Audio coupling (design pedal circuits, hear sound instantly)
- π Category theory optimization (verified composition, automatic fusion)
- π User extensibility (plugin system for custom domains)
- π― 50+ integrated domains (audio, physics, chemistry, graphics, AI)
Timeline: Current v0.11.0 β v1.0 release in 2026-Q2
Morphogen programs describe time-evolving systems through flow blocks:
flow(dt=0.01, steps=1000) {
# Execute this block 1000 times with timestep 0.01
temp = diffuse(temp, rate=0.1, dt)
output colorize(temp, palette="fire")
}
Persistent variables are declared with @state:
@state vel : Field2D<Vec2<f32>> = zeros((256, 256))
@state agents : Agents<Particle> = alloc(count=1000)
flow(dt=0.01) {
vel = advect(vel, vel, dt) # Updates vel for next step
agents = integrate(agents, dt) # Updates agents for next step
}
All randomness is explicit via RNG objects:
@state agents : Agents<Particle> = alloc(count=100, init=spawn_random)
fn spawn_random(id: u32, rng: RNG) -> Particle {
return Particle {
pos: rng.uniform_vec2(min=(0, 0), max=(100, 100)),
vel: rng.normal_vec2(mean=(0, 0), std=(1, 1))
}
}
Types can carry dimensional information:
temp : Field2D<f32 [K]> # Temperature in Kelvin
pos : Vec2<f32 [m]> # Position in meters
vel : Vec2<f32 [m/s]> # Velocity in m/s
force : Vec2<f32 [N]> # Force in Newtons
# Unit checking at compile time
dist : f32 [m] = 10.0
time : f32 [s] = 2.0
speed = dist / time # OK: f32 [m/s]
# ERROR: cannot mix incompatible units
x = dist + time # ERROR: m + s is invalid
Morphogen provides 25 fully-integrated domains accessible via the use statement, with 15 additional legacy domains in migration. Each domain offers specialized operators optimized for its computational model.
Field Operations (19 ops) - PDE solvers, diffusion, advection, stencils Agent Systems (13 ops) - Particle simulations, flocking, N-body forces Audio Synthesis (60 ops) - Oscillators, filters, effects, physical modeling RigidBody Physics (12 ops) - 2D dynamics, collisions, constraints
Physics & Simulation - field, agent, rigidbody, integrators, acoustics Audio & Signal - audio, signal, temporal Graphics & Visual - visual, color, image, noise, palette, terrain, vision AI & Optimization - neural, optimization, genetic, cellular, statemachine Data & Infrastructure - graph, sparse_linalg, io_storage, geometry Circuit - circuit (Phase 1: DC/AC/transient analysis)
Chemistry Suite (9 domains) - molecular, qchem, thermo, kinetics, electrochem, catalysis, transport, multiphase, combustion Specialized Physics (4 domains) - thermal_ode, fluid_network, fluid_jet Audio Extensions (2 domains) - audio_analysis, instrument_model
π View Full Domain Catalog - Detailed descriptions, code examples, and feature lists
Status Analysis: See DOMAIN_STATUS_ANALYSIS.md for detailed breakdown of active vs. legacy domains
Migration Plan: Legacy domains will be integrated in v0.12.0 - see Migration Guide
use field, visual
@state vel : Field2D<Vec2<f32 [m/s]>> = zeros((256, 256))
@state density : Field2D<f32> = zeros((256, 256))
const VISCOSITY : f32 = 0.001
const DIFFUSION : f32 = 0.0001
flow(dt=0.01, steps=1000) {
# Advect velocity
vel = advect(vel, vel, dt, method="maccormack")
# Diffuse velocity (viscosity)
vel = diffuse(vel, rate=VISCOSITY, dt, iterations=20)
# Project (incompressibility)
vel = project(vel, method="cg", max_iterations=50)
# Advect and diffuse density
density = advect(density, vel, dt)
density = diffuse(density, rate=DIFFUSION, dt)
# Dissipation
density = density * 0.995
# Visualize
output colorize(density, palette="viridis")
}
use field, visual
@state u : Field2D<f32> = ones((256, 256))
@state v : Field2D<f32> = zeros((256, 256))
const Du : f32 = 0.16
const Dv : f32 = 0.08
const F : f32 = 0.060
const K : f32 = 0.062
flow(dt=1.0, steps=10000) {
# Gray-Scott reaction
let uvv = u * v * v
let du_dt = Du * laplacian(u) - uvv + F * (1.0 - u)
let dv_dt = Dv * laplacian(v) + uvv - (F + K) * v
u = u + du_dt * dt
v = v + dv_dt * dt
# Visualize
output colorize(v, palette="viridis")
}
π More Examples: See the examples/ directory for 24 working programs demonstrating all major domains!
- Getting Started Guide - Installation, first program, core concepts
- Domain Catalog - Complete catalog of all 40+ domains with examples
- docs/README.md - Documentation navigation and index
- SPECIFICATION.md - Complete language specification (2,282 lines)
- Architecture - System design and MLIR compilation
- Specifications - Domain-specific technical specs
- ADRs - Architectural decision records
- STATUS.md - Current implementation status by domain
- CHANGELOG.md - Version history and release notes
- Domain Implementation Guide - How to add new domains
Morphogen is building toward a future where professional domains seamlessly compose:
Education & Academia - Multi-physics simulations, interactive visualizations, reproducible research
Digital Twins & Enterprise - Real-time system simulation, predictive maintenance, optimization workflows
Audio Production & Lutherie - Physical modeling synthesis, instrument design, timbre extraction
Scientific Computing - Coupled PDE systems, reaction-diffusion, quantum chemistry
Creative Coding & Generative Art - Procedural generation, audio-reactive visuals, deterministic creativity
Morphogen v0.3.1 is the evolution of Creative Computation DSL v0.2.2, incorporating:
- Better semantics:
flow(dt)blocks,@statedeclarations, explicit RNG - Clearer branding: "Morphogen" is unique and memorable
- Same foundation: Frontend work carries forward, comprehensive stdlib preserved
RiffStack - Live performance shell for Morphogen.Audio
RiffStack is a stack-based, YAML-driven performance environment that serves as the live interface to Morphogen.Audio. While Morphogen.Audio provides the compositional language layer, RiffStack offers real-time interaction and performance capabilities. Together they form a complete audio synthesis and performance ecosystem built on Morphogen's deterministic execution kernel.
Morphogen is building toward something transformative: a universal platform where professional domains that have never talked before can seamlessly compose. Contributions welcome at all levels!
See CONTRIBUTING.md for:
- Development setup
- High-impact contribution areas
- Code style guidelines
- Pull request process
Quick links:
Apache 2.0 - see LICENSE for details
Copyright 2025 Semantic Infrastructure Lab Contributors
- GitHub: https://github.com/scottsen/morphogen
- Issues: https://github.com/scottsen/morphogen/issues
- Discussions: https://github.com/scottsen/morphogen/discussions
Status: v0.11.0 β v1.0 Release Plan Active | Current Version: 0.11.0 | Target: v1.0 (2026-Q2) | Last Updated: 2025-11-21
π View Roadmap - Unified roadmap to v1.0 (Q2 2026)