Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: NoiSQL – Generating Music with SQL Queries (github.com/clickhouse)
4 points by zX41ZdbW on April 3, 2023 | hide | past | favorite | 1 comment
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.




I've added two more examples yesterday (music4.sql and music5.sql): https://github.com/ClickHouse/NoiSQL/blob/main/music4.sql#L1...

ChatGPT helps to overcome the shame of composing melodies by myself.




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

Search: