Skip to content

cemkod/wavemorphs

Repository files navigation

WaveMorphs

A browser-based genetic algorithm tool for evolving wavetable synthesizer waveforms. No dependencies — pure TypeScript with Web Audio API and Canvas.

Live Demo

What it does

WaveMorphs generates wavetables by evolving harmonic content through selection. Start from a random waveform, audition 8 mutated offspring, pick the one you like, and repeat. Each generation mutates the harmonic spectrum, a polynomial waveshaper, and a low-pass cutoff — producing complex, evolving timbres that morph across the wavetable's frames.

How to use

  • Single-click a cell to preview its sound
  • Double-click a cell to select it as the new parent and breed the next generation
  • Space — play/stop the current parent
  • R — generate a new random parent
  • Ctrl+Z — undo last selection (up to 20 steps)
  • Crossover — click the Crossover button, then double-click two offspring to breed them together

Adjust Mutation Rate to control how different offspring are from their parent. Higher rates produce more chaotic variations; lower rates make subtle tweaks.

Export formats

Format Description
.wav 16-bit stereo WAV, 128 frames × 2048 samples
.f32 Raw 32-bit float samples, same dimensions
.wt Serum-compatible wavetable format

Gene structure

Each waveform is encoded as:

  • Harmonic partials — up to 10 harmonics with per-keyframe amplitude multipliers that interpolate across frames
  • Waveshaper — an evolved polynomial AST (a·b + c nodes) applied to the summed waveform
  • Cutoff — normalized low-pass filter position

Development

npm install
npm run dev      # dev server at localhost:5173
npm run build    # TypeScript check + production build
npm run preview  # preview production build

Requires Node 18+. No external runtime dependencies.

Deployment

Pushes to main automatically deploy to GitHub Pages via the included workflow.

License

GPLv3 — see LICENSE.

About

A biomorphs-like wavetable breeder

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors