A demo project, I created for fun. There is nothing new in realtime programmatic audio synthesis. But it feels great when you recursively wrap around the sine waves, envelopes, effects and melodies down to the PCM signal, using a declarative language. I think this project has educational value - it can guide you through the basics of signal processing.
Example:
SELECT mono(output(
arraySum(x -> 1 / 6
* running_envelope(30 * (1 + x / 6), time, 0.05 * x, 0.005, lfo(0, 0.25, sine_wave, time / 8), 0.1)
* sine_wave(time * 80 * exp2(x / 3)),
range(12))))
FROM table;
This generates some strange dark beat with an ambient melody that is perfectly listenable. See more examples in the repository.
PS. An HN user Anigbrowl said "years of your life not refundable; synthesizers are nerd crack" (https://news.ycombinator.com/item?id=33892009) - I cannot agree more.
ChatGPT helps to overcome the shame of composing melodies by myself.