Elementary Audio: a modern platform for writing high performance audio software
Hey all, Nick from Elementary Audio here. I spent some time in the discussion below yesterday and coming back to it again now I can see this continued to get way more attention than I expected! Thanks for all of your thoughts.<p>There&#x27;s a lot of discussion here, and although I&#x27;d love to visit every comment in specific I think it makes sense to speak in summary to a few of the major themes&#x2F;underlying questions here. In general, the discussion here surrounds totally valid concerns that I&#x27;ll try to cover, and I understand after this thread that my messaging needs some serious work to speak to those concerns.<p>Before I get to those questions, I want to start with some of the things that Elementary is _not_ well suited for, or some areas where Elementary currently has some limitations.<p>* It&#x27;s a young project; there are plenty of standard library features that are not implemented yet (oversampling, several more filter topologies, iFFT, etc). That might mean Elementary is currently ill-suited for your project<p>* It uses a generalized, block-based graph rendering algorithm. If you have hard performance requirements or need highly specific and hand tuned DSP optimizations, Elementary is currently not ready for you.<p>* Because of the current rendering algorithm, you cannot specify signal flow graphs that have 1-sample feedback loops.<p>With that out of the way, let&#x27;s talk through some of the questions here that seem to underly many of the comments.<p>1. Why JavaScript?<p>* It&#x27;s inarguably one of the most widely used languages in the world<p>* It&#x27;s more than fast enough for the role that it plays in Elementary<p>* It&#x27;s the language of the web; which isn&#x27;t going anywhere any time soon, and at the same time the industry is showing us demand for audio software that runs in the web.<p>* JavaScript&#x2F;web tech has pioneered the way that we write app UIs over the last decade, and continues to do so<p>* JavaScript&#x2F;web tech has pioneered oen of the best developer experience&#x2F;workflows in software development<p>2. How can JavaScript possibly be fast enough for this?<p>* Elementary uses JavaScript only to _describe_ audio processes, not execute them<p>* All of the actual audio processing is handled in the underlying C++ audio engine<p>* This engine is compiled to native, platform-specific targets in the appropriate cases (i.e. plugins, cli), and only compiled to WASM when appropriate for running in the browser<p>* The description of the audio process is done with an extremely lightweight virtual representation for which JavaScript is more than fast enough, and for which garbage collection and seamless integration with application logic and user interface programming is desirable<p>3. What about latency?<p>* The core audio engine adds no audio latency overhead whatsoever; if you&#x27;re running a platform&#x2F;native target, you&#x27;re running with the same latency that your drivers&#x2F;plugin host are delivering to Elementary. Until, of course, you describe an audio graph which introduces new latency; that&#x27;s on you.<p>* When compiled to WASM to run in the browser, of course there&#x27;s additional implications here, but that&#x27;s a reality of targeting the web in the first place. Elementary doesn&#x27;t force you to the web, or force you to wasm, but if you want to run in the web, accepting the latency implications yourself for your own apps, Elementary can go there with you<p>4. What about bottom line performance? Professional, commercial software??<p>* Elementary will not make the claim that for executing a static graph it will outperform native C&#x2F;C++ hand-tailored to the application demands. That would be crazy; it&#x27;s probably fair to say that highly specialized code can always outperform generalized algorithms.<p>* Elementary will make the claim that for plenty of applications, generalized graph processing is surely fast enough.<p>* The generalized graph processing algorithm is fast enough because the audio processing is purely native (or compiled to wasm); we do not execute any JavaScript itself on the audio processing thread<p>5. What about Faust&#x2F;SuperCollider&#x2F;PureData&#x2F;ChucK&#x2F;Max...?<p>* I have direct experience with many of these languages, and have reviewed almost all of the others in detail. I think they&#x27;re excellent pieces of software for prototyping and exploring. I also think they&#x27;re generally weaker for shipping complete applications.<p>* Of course you can use Faust&#x2F;Max Gen or similar to generate C++ and then bolt on your own application harness, and I&#x27;d encourage you to try. For non-trivial applications, interfacing between the UI and the DSP becomes cumbersome. Elementary aims to provide a better experience here.<p>6. Why do any of this at all?<p>The current dev process and workflow for writing audio software has stagnated; it takes so much time to turn a prototype into a product and we regularly accept complexities and limitations that for so many types of apps we no longer need to accept. Elementary offers a new way of prototyping and shipping those apps more easily and more quickly.<p>Thanks again for all the discussion, I hope this clears up some of the details.<p>Cheers,
Nick