Hacker News new | ask | show | jobs
by kaoD 526 days ago
Similar to this, a while ago I made this online playground (Lambda Musika) where you can program sound realtime in your browser (using JS) in a functional-ish way:

https://lambda.cuesta.dev/ (repo: https://github.com/alvaro-cuesta/lambda-musika) -- check out the examples on the bottom toolbar's blue button.

The basic idea is you write a function `t => [l, r]` where `t` is time and `l`, `r` are output samples for the left and right channels in `[-1, 1]` range. You can think of it like ShaderToy but for sound synthesis.

It includes a small utility library but it's meant to be just a few helper functions instead of a full-fledged framework like SuperCollider, Sonic Pi, et al. I.e. it's still sample-oriented instead of module-oriented. E.g. in Sonic Pi you script modules, their parameters, and how they connect with each other, while Lambda Musika is all about outputting samples of a waveform.

It's very barebones -- I'd love to get some time to upgrade this to Monaco editor and add TS, intellisense, etc. -- and possibly buggy, but I still find myself coming from time to have some fun with it.