Template for Rust-based SuperCollider plugins

Hi all

I have made a small github template for creating SuperCollider plugins with Rust being used for processing audio samples. It also includes some nice extras like the CPM package manager so you don’t have to clone the supercollider source code yourself every time.

It’s currently just a dead simple example where Rust is used to apply gain to samples. But hey, maybe a rust-based gain just sounds better because it’s safer? (joking, of course). Have fun.

4 Likes

The corrosion cmake integration is awesome. Thanks for this.

It looks like you have the same issue I was having, which is you can only get each next sample from rust and cannot pass a memory pointer. Did you try to do that and fail or did you just not try to do it? (I have only failed, haha).

Sam

1 Like

I haven’t tried it yet but it should be possible with the cxxbridge included here. I just feel a bit more comfortable doing it per-sample in terms of safety to be honest but I am also still new to Rust so I am probably just paranoid here, but I feel like it should be possible?

I updated the template now to make a few things easier.

  • You no longer need to set the install path for your plugins, this is done automatically (you also don’t need to clone any SuperCollider source code, but that’s old news).
  • VSCode / Neovim Overseer tasks. If you use any of these editors you don’t need to run any manual commands yourself, it’s all registered inside your editor. Just build and go.
  • A build script to make building easier (and to automatically find out where to install the plugins)
3 Likes

It would be even cooler if we could make something like this but for SuperCollider, ie make it possible to write a SuperCollider plugin in pure Rust.

1 Like

(looks a bit raw though…)

Whoa. This is quite appealing to me. Any reports on how it’s coming along?