r/AudioProgramming • u/StockStart825 • Sep 29 '26
Curious about Rust for audio programming
Hey everyone! I’m a product designer and musician interested in building audio plugins and music tools, including their interfaces.
I’ve started learning C++, but I’m curious about Rust. Has anyone tried working and building audio plugins using Rust? Did not found any courses or tutorial with Rust and audio programming
(I am super new to programming with C++ and audio programming)
11
Upvotes
5
u/to7m Sep 29 '26
I looked into Rust for audio plugins briefly, and couldn't see a sensible way to start with it.
To start with getting your head around DSP and branchless programming, you might want to look into the SuperCollider live audio language.
If you want to build your first plugin, I suggest using a plugin framework in C++. DISTRHO Plugin Framework got me started. There's also JUCE which is used a lot.
2
u/activematrix99 Sep 29 '26
Sure, take a look at CPAL and the audio crate, you'll be amazed.
2
u/dkode80 Sep 29 '26
There’s a real decent discord. I think it’s called rust audio. Pretty active
2
u/New-Incident-3289 Sep 29 '26
I used pure rust to write https://github.com/fabiohl/NeuralAmpModeler-rs and its downstreams. So I super recommend and love it.
https://github.com/robbert-vdh/nih-plug is a great framework for various plugins formats (like VST3 and others). But for https://github.com/fabiohl/NAM-Plug I preferred using https://crates.io/crates/clack-plugin cause It's more speciallized to CLAP format.
2
u/HommeMusical Oct 03 '26
If you haven't done any programming at all, I don't think that C++ or Rust are the way to start. I think you should start learning Python.
Python is a much, much easier language to learn and to tinker with. You can literally sit down and experiment in the terminal with all the data structures, or with structures you have built. It's elegant, it's clear, and you also have access to cutting edge technology, like modern AI models and training, which you don't have in C++.
On a halfway decent modern machine, you can do perfectly good synthesis in Python, using numpy or torch for the computations.
I have this synth, it gets a dozen voices and more without breaking into a sweat on my machine that was pretty good five years ago, and it gets six voices on the oldest machine I could find, some barely functioning windows machine a friend had.
https://github.com/rec/tuney/
I think that if you start right into a compiled language like C++, there's a big chance that you'd be overwhelmed by the complexity of the weird and unimportant details of the language.
Here's what I wrote before I read that you were a beginner.
I programmed in C++ for over twenty years but it is a slowly dying language for many reasons too tedious to go into, mainly the huge complexity of the language after all these decades, and the inability to ever get rid of any feature no matter how horrible.
I would strongly not recommend putting time into learning C++ unless you have a compensated project. You could learn an amazing amount, quite slowly and painfully, by learning C++, but then you are stuck with a skill in a slowly deflating market full of old white guys and a not-so-loving community (unlike Python or apparently Rust).
Rust is the wave of the future. All that cruft is gone, and there is also a formalized memory management and ownership system. I believe Rust will be easier for coding assistants to understand, because everything is very explicit - C++ has these... interesting ways of doing this things like resolving the meaning of a symbol in code that are hard to reason about by humans, and even worse for LLMs, because they require a potentially huge scope of context.
Rust programs can be called pretty directly by C++ with a tiny interface that costs infinitesimal amounts of CPU, so I don't believe any work you use will be wasted.
2
u/dogweather Oct 11 '26
I’m using Rust for commercial DSP development. It’s worlds better than C++ for me. It feels like a modern programming ecosystem.
5
u/IcEarthlight Sep 29 '26
Check this out https://github.com/robbert-vdh/nih-plug. Although I haven't used it myself, quite a few plugins are using this framework recently.
3
u/Apellum Sep 29 '26
To me Rust makes it easier to get right into the programming. With C++ you’ll be fighting a lot of things alongside the programming that aren’t programming like build tools, CMake, integrating testing, making sure you’re using the right compiler, etc. there’s just a lot of things that take away from the programming itself that I find vastly more difficult than with Rust.
The hard part with Rust is that it’s significantly less mature especially for audio tech, but its package management and dev tooling are so smooth to use. On top of that the error messages you get when trying to compile a program are really helpful / not esoteric
2
u/Puzzleheaded-Lab-635 Sep 29 '26
Orthogonal, I’m using rust to write firmware for synthesizers. It’s been extremely pleasant thus far.
1
u/General_Estimate_420 Sep 29 '26
Right now Rust can be problematic for developing industry standard plugin formats. Something you may want to look into before jumping into it full bore. Aside from that you'd better be well prepared in DSP programming especially in multi-component environments.
1
u/lizzymeister Sep 29 '26
i heard good things about truce.audio
1
u/all3cylinders Sep 29 '26
bilinear audio is using rust
2
u/[deleted] Sep 29 '26
[removed] — view removed comment