176 points · by zX41ZdbW · 3y ago · 14 comments
Here is how it looks:
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;
To check how it sounds, find the examples in the repository https://github.com/ClickHouse/NoiSQL> You could argue that modern AI, for example, Riffusion, can do a better job. The counterargument is - if you enjoy what you are doing, it's better not to care if someone does it better but with less pleasure.
I did something similar for defining an image processing pipeline using SQL queries (SQLite UDFs bound to .NET CV methods). Totally unnecessary and performance was weird, but the elegance of using SQL abstractions like recursive CTEs to accomplish fun things is the entire point, IMO.
Thinking about the era of LLMs - the ability to quickly convert natural language into a SQL query might open up some additional fun tricks here.
And it does cover something that is often missing from these kind of tools: some explanations to get started with it!
When I was doing it, I had an impression that everyone else already knew about signal processing, electrical engineering, functional calculus, music theory, and sound engineering... While I only have a chance to touch it barely :)
I haven't in the last few as I make horrific noises with SQL instead ;)
and I am planning to have more bytebeat style of examples.
Étienne de Query ; Mod-Select * ;