Rust Audio

VST 2019 Tutorial Ideas

Last January, I created a simple tutorial on my dev blog site on how to create a synthesizer with the vst crate. It’s been over a year since, and I think it’s due for an update. While still largely valid, the video needs work (I didn’t have my rust compiler set up properly at the time lol [and also I got a wayyyyy better mic since]) and the end-result could be a bit more “exciting” than a white noise generator.

We can use this thread to discuss ideas about further tutorials. Some questions to keep in mind:

  • Should it be beginner-focused, like the last one? Or delve into more complicated subjects?
  • What can be simple to understand, but more interesting than white noise?
  • Perhaps an effect is the way to go? Or maybe synths are more fun?

I think the ideal tutorial would actually be a collection of tutorials, not just one:

  1. Barebones skeleton: VST that does nothing (and prove it works in a DAW)
  2. Build on top of #1 by making a simple sine synth with MIDI inputs
  3. Build on top of #2 by making it polyphonic (start to dive into some synth-related data structures :smiley:)
  4. Build on top of #1 by making an effect (contrast with #2 and #3 by showing you can take audio inputs, not just MIDI)
  5. Build on top of all of the above by taking both audio and midi and combining it somehow – maybe a very stupid vocoder or something

[EDIT]: Oh, and we probably want a tutorial about how to work with the parameters too.

etc etc. You get the idea. Eventually we can build all the way up to a GUI example in (insert very long time here) when we finally land it :slight_smile:

The only problem I’d be worried with is if we change the API, you’d have to change all the tutorials as well. I know there’s actually a feature in Rust’s documentation that it will compile any code embedded in the documentation and make sure it still works – not sure if we can leverage that for tutorials or something?


That’s a great idea, actually. We could structure it similarly to how Martin Finke did in those WDL-OL tuts. I like synths because I think they’re more exciting for the most part, since it’s completely generated. But I’d like to have an effect tutorial too. I hadn’t thought about breaking it up, but that would be a lot easier to maintain.

As far as testing documentation, I’m unsure. I wonder if the Rust book does anything like that, or if it’s a strictly cargo doc feature. Perhaps we could write in cargo doc, and then autogen a markdown page for a site :thinking:. In any case, it would be nice to maintain docs for older versions as well - Amethyst does this with their book (latest release vs. master). I like that approach as it helps highlight breaking changes between versions in an easy-to-digest way.

Next step is to figure out what to build. As you said, a sine synth is probably a good goal to work towards since it doesn’t require knowledge of more advanced stuff like band-limiting, etc. I liked Rob’s dimension expander in our examples folder effect wise (maybe we could even combine the two? :smiley: )

1 Like

I’m thinking a simple delay might be easy as well – at least while you’re still in the beginning stages, not worrying about evaluation graph shenanigans. Pretty apparent effect, too.

Both are probably pretty decent examples though.

1 Like

Oh, I like that even better - delay is much easier for someone to hear, especially without headphones, etc.

Since the old one does not touch on parameters, most of it is probably still valid after the thread safety changes. A “part 2” that explains how to use parameters with the new API could be great!