Files
code-sinth/examples/arp.patch
Jose Luis Montañes 7debc7436e initial: code-sinth — DSL-driven modular synth (Python engine + web app)
Patch language with osc/noise/trig/seq/adsr/filter/delay/poly + voice templates
and inline live values. Two runtimes:

- code_sinth/ — Python engine (numpy + sounddevice). Hot-reload via mtime
  watcher. Offline render to WAV. Static-HTTP+WS visualizer (viz/) that
  injects waveforms next to each `node X = ...` line.
- web/ — port of the engine to JS running in AudioWorklet. Single static
  page with CodeMirror 6 editor (line widgets for live waveforms) and a
  control surface on the right with knobs/faders/step_seq/piano_roll
  declared from the patch. State preserved across hot-reload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 17:37:06 +02:00

11 lines
441 B
Diff

# Arpegio: Am7 ascendente y descendente sobre 8 pasos.
# clk y mel comparten rate (8 pasos/seg) por lo que arrancan en fase desde t=0.
node clk = trig(period=0.125, duration=0.06)
node mel = seq(rate=8, steps=[220.0, 261.63, 329.63, 392.0, 523.25, 392.0, 329.63, 261.63])
node o1 = osc(saw, freq=mel)
node env = adsr(a=0.005, d=0.08, s=0.3, r=0.08, gate=clk)
node lp = filter(lp, in=o1, cutoff=300 + env*3000, q=3.0)
out <- lp * env * 0.5