synth4
a text based audio-visual modular-synthesizer
video of the latest version (v0.8.0)
the script used to generate the above video
older video that writes a script from scratch (v0.6)
features
- realtime editing of the scripts
- three parts to it, audio generation, graphics generation, and a fullscreen post-effects chain
- all variables used in either the audio or graphics code can be exported to the other side. this allows using things like audio oscillators and filter positions to modulate positions of graphics primitives, and using graphics primitive positions to modulate the audio
- audio can be routed to the post-effects shaders
- shaders are written in the same script as everything else (no need to write metal or hlsl or whatever)
- graphics primitives are currently all signed distance fields that can be chained together
- very basic support for midi 1.0 devices
- currently pre-pre-alpha, but fairly stable. it has only been tested so far on a 2020 M1 macbook air.
download
download v0.8.0 (sept 2026) (requires osx)
usage
this example script explains the basics of the scripting language
the program is essentially a multimode text editor (sort of like vi or whatever)
- drag and drop of text files is supported. easier to load scripts that way.
- shift+i = insert text.
- shift+v = variable-viewer mode. as the cursor moves around, any symbols underneath it have their current contents displayed. this is primarily useful for debugging the output of functions throughout the script. when viewing float_arrays, tab can be pressed to alternate between a 'current value' display, and a 'history' display.
- shift+m = midi mode. this lets the computer keyboard be used to send midi inputs into the script. the mapping from keys to midi note indices can be seen and edited in the settings.txt file
- shift+c = debug camera mode. needs work but lets you move the camera around a bit
- shift+: = console mode. a list of commands can be seen by pressing tab while in this mode. tab will also autocomplete the commands where possible.
- use escape to back out of these modes
keyboard shortcuts for text navigation
- arrows to move the cursor
- arrows+command to move the cursor to the start and end of line or file
- arrows+option to move the cursor word by word
- all of the above + shift will generate text selections
- command+c/command+v for copy/paste (this uses the os, so copy/paste to/from other programs should work)
- command+z/command+z+shift for undo/redo
documentation
additional notes
- variables will be converted to other types if an exact function match isnt found.
- there are a series of constants that are available in different contexts
anything is not a distinct type, it is a shorthand for functions that accept all types (rather than listing every single combination). in the same vein, some functions are parameters are displayed as audio|number and will accept audio, float or integer types as inputs.
point3, point3 and point4 support r, g, b and a as aliases for x, y, z and w. they also support swizzle operations, eg: value.xx(), value.xyy(), value.bgra(), etc.
future
open to other suggestions ofc, but some broad strokes plans are:
- general
- switch from AST walk to bytecode or something. the current method is embarrassingly slow in the profiler, and there are some scripts where its slower than the GPU frametime. lol.
- this is probably what v0.9.0 will be.
- better error display while script editing
- better console commands. currently only supporting save/load and some other minor debugging bits and pieces
- better documentation, both here and within the program itself
- more graphical stuff in the ui (eg editing an adsr curve graphically, but it gets written into the script textually)
- windows version? web version? (post v1.0)
- audio
- more of everything: bitcrushers, delays, reverb, panning, equalisers, mixers, ...
- better midi support
- 3d sound using inputs from the scene thread
- samplers, better sequencers
- line-in. could be cool to have visuals reacting to voice inputs etc
- etc
- scene
- considering adding interval rendering so that things like
draw("sin(x)") would work
- better lighting, materials, textures, ...
- volumetrics would be cool
- particle systems
- procedural meshes (not SDF related)
- text
- etc
- shaders/post
- there are a lot of script functions that arent available in shader code that could be (eg
midi(), button(), slider(), etc), that currently need to be called in post() and passed into shaders
other
lots of old looping trippy gifs from back in the day
there is a patreon if you're into that kind of thing
written in c++. no game engines. no ai.
last updated 28-08-2026