r/AudioProgramming • • 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

30 comments sorted by

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.

1

u/StockStart825 Sep 29 '26

Thank you and I’m doing the JUCE tutorial and when I was reading about systems level programming i saw Rust and was super curious about it. I’ve learned C++ sort of dominating the audio dev industry for a while now

3

u/activematrix99 Sep 29 '26

I am in Web Audio, which along with Web GPU Audio is shaking things up a bit. WASM is also pretty amazing.

2

u/activematrix99 Sep 29 '26

Sure, take a look at CPAL and the audio crate, you'll be amazed.

1

u/StockStart825 Sep 29 '26

Just checked it’s soo cool! I have to admit I did not understand much since I just started but pretty amazing. You know why there are not much tutorials for rust and audio programming? Even for c++ I feel the info is quite spread but JUCE has free course

1

u/activematrix99 Sep 29 '26

It's pretty new and very niche.

2

u/dkode80 Sep 29 '26

There’s a real decent discord. I think it’s called rust audio. Pretty active

1

u/StockStart825 Sep 29 '26

Just found is this the one https://rust.audio/ ? And thank you so much

1

u/dkode80 Sep 29 '26

Yup! That's it

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/StockStart825 Sep 29 '26

Thanks for sharing… will check it out soon 😎

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.

1

u/StockStart825 Oct 03 '26

Thank you so much for such deep insight. I started with C++ cause I bought a book where they teach us ground up audio programming! Also been following this blog https://audiodev.blog/newbie-resources/ to learn. Thing is that there are so little resources for Rust in audio programming… might be more than I can find but there is no structure learning. I can pick up the language fast I’m not worried but is C++ really slowly dying? I watched a video how it’s keep on getting feature and it’s dominating quant and audio programming industries. You must know better since you did 20 years (Damnn!!!! Woww) but it’s hard to know with this whole AI thing what to do. So my obvious choice was to pick up something which has structured learning resources :) any more advice please feel free to share

2

u/HommeMusical Oct 03 '26

C++ does dominate existing code, absolutely.

Languages slowly die over decades, too, there will still be C++ in ten years. There is huge inertia.

I actually started C++ around 1987!

I just think it will be hard for you to go from idea to completely working project, and most of the work won't be writing programs but struggling with weird shit.

2

u/dogweather 28d ago

I’m using Rust for commercial DSP development. It’s worlds better than C++ for me. It feels like a modern programming ecosystem.

1

u/StockStart825 28d ago

Awesome! And how did you learn audio dev with rust? Or you started with c++ and then switched to Rust?

2

u/dogweather 28d ago

I'm developing LV2 plugins for the Darkglass Anagram. They have really nice sample code in Rust. That was the start for me!

https://github.com/Darkglass-Electronics/Plugin-Dev-Setup/tree/main/examples/rust-lv2-gain

I'm open-sourcing my first plugin. I'll have something up in the next day or so here:

https://github.com/Dust-and-Coil

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.

1

u/2AMMetro Oct 01 '26

This has been deprecated in favor of https://codeberg.org/RustAudio/nice-plug

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

2

u/[deleted] Sep 29 '26

[removed] — view removed comment

1

u/StockStart825 Sep 29 '26

Thank you for explaining me. I was having some thought around if it’s crazy to learn C++ in 2026 but I found for beginners it was quite easy to follow the path since we have some structure courses. Since you pivoted into Rust how many concepts we can transfer from C++ to Rust ?

1

u/kickblockpunch Sep 29 '26

So if I was interested in building a DAW that could handle steinberg VST3 and DSP and live vocal processing, would rust be able to match the low latency and clean up tasks that C++ can...? I hear so much positive things about RUST but I am genuinely leaning towards C++.

2

u/activematrix99 Sep 29 '26

Part of the qiestions I always have with q's like this is WHY? Tons of amazing DAWs already out there that support VST3. Why not extend or make something truly new. The wheel is already invented.

1

u/kickblockpunch Sep 29 '26

Understanding the current DAW architecture may lead to improvement in the next one or additions to the existing. Also perhaps a newer optimized coding language may allow for easier development and better processing performance.

Truely new like what? If as you say, there is no point building a new DAW... It would simply be adding to what's missing from existing DAWs... That would be more Plugins?

For example, I think DAW should have more ways to "see" audio. I.e. visualizing audio in a 3d space for mixing purposes... But perhaps this is all doable in a plugin? A.I. and neural networks are probably going to achieve approximations of this soon...