Hacker News new | ask | show | jobs
by trypwire 1808 days ago
> Does this support writing audio sample processing code in JavaScript?

Currently, no. My intention is that the library of pre-existing nodes is both complete enough and low-level enough that 95% of things end users may wish to write can be done through this composition. That said, the embedded runtime engine is designed to be extended with your own C++ processors if you have an application which particularly needs that level of customization.

And why pure functions? Functions with side effects don't compose the way that pure functions do, because you can't rely on deterministic output given a consistent input. If you choose, you can still write your own non-pure functions to assemble your signal graphs, though I personally wouldn't recommend it :) The Elementary library will always aim to be strictly pure functions.

1 comments

Thanks for the reply. I see parallels to the Web Audio API (https://www.w3.org/TR/webaudio/) which is mostly for creating graphs of nodes using the browser's native code to do the processing.

It's hard to do real-time audio sample processing in JavaScript since the language isn't designed for real-time. Maybe a restricted subset would work.