Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Building musical synthesizers with SQL queries (github.com/clickhouse)
176 points by zX41ZdbW on April 7, 2023 | hide | past | favorite | 14 comments
If you already know what bytebeat is, you don't need an explanation. If not, check my project :)

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



I love this quote.

> 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 think this kind of thing is very cool.

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.


Very nice!

And it does cover something that is often missing from these kind of tools: some explanations to get started with it!


Thank you! This topic is also new to me.

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 :)


This is absolutely ridiculous. I love it.


I tend to open, and play, with https://github.com/VCVRack/Rack daily...

I haven't in the last few as I make horrific noises with SQL instead ;)


very cool stuff! really inspiring. I am developing https://github.com/chaosprint/glicol

and I am planning to have more bytebeat style of examples.


This is beautiful. Well done.


Be honest OP, this was the result of a drunken bet, right?


It was an attempt to prepare a topic for a conference named "Doing weird stuff with ClickHouse" half a year ago. I already had an example of generating pictures, and some memory about bytebeat, so trying to generate sound was a natural next step. But the first (hundred) attempts were unsatisfactory.


Nothing useful, yet :

Étienne de Query ; Mod-Select * ;


Is it vulnerable to SQL injection?


Rick-roll injection attacks.


frequency modulation attack




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: