Hey guys! Wrote this blog post on writing VST3 plugins in Zig, thought some of you might be interested
Awesome! I used to be an audio engineer so this is really cool to look at. Great info for anyone who’s ever wondered how VST plugins work.
Glad you enjoyed it! Hopefully more to come in the future
Hello Oliver!
I’ve just stumbled on your post today – thanks for sharing!
I’m new both to audio programming and to Zig, and I’ve been looking for resources about Zig for audio programming.
I hope you don’t mind me asking some questions: judging from the preamble of your article about the CLAP format, it would be a lot easier to write a CLAP plugin in Zig – yes?
I am thinking on trying that, but since I’m new to everything I am worried that it might be too much “new things” at the same time…
I’m wondering if I should try implementing a simple plugin in C before attempting something in Zig… All the examples I find are in C++ – while I can do C, but C++ not really…
Any thoughts on implementing a CLAP plugin in Zig? How would you go about doing that?
Thanks!
There is an existing project doing CLAP plugins in Zig. Don’t have a link ATM, but search the Zig Programming Language Discord projects list.
You might be referring to this?
Here’s one: Discord
Thanks for sharing that – I had to revive my Discord account in order to access the link, so here is the link for future non-Discorders: GitHub - GreyDodger/zig-clap-noise-shaker: Noise Shaker: Clap audio plugin written in Zig
VST3 is what you want to be writing. It is an industry standard and will be for the foreseeable future.
Isn’t VST3 owned by Steinberg?
Personally, I’d target primarily CLAP, a free and open source standard for audio plugins. There exist adapters to adapt VTS2/3 and AUs from CLAP.
Yeah it is by Steinberg, but VST/VST3 is the industry standard unless you’re in Pro Tools (which uses super proprietary AAX.) No matter what (Non-AVID) DAW and tools your workflow is, you will use VST and VST3.
When working in audio you need hardcore realtime processing, complete stability, controller standards adherence, and flawless interop of your plugins between all your tools.
For toy projects to learn about doing audio processing in a plugin CLAP is fine but if you plan to build something to use it should be in VST or VST3.
Unrelated weird side note about something I don’t really have an explanation for: VST2 is insanely rarely used. I have hundreds of plugins from over a dozen vendors/devs, and I’m not sure if any are VST2.
- Jas
VST2 has been deprecated for years. New devs can’t get a license for it. It still lives on because of enertia, and lots of extant working plugins that are no longer being developed, yet remain useful.
i’m sure Ableton will come around to implement it, and when they do, VST version will be essential only to “professional” tools that might be used in these gargantua of Pro Tools, Cubase, etc. Especially considering that clap has vst wrappers.
I think there’s a little bit of mystification going on in this thread. There’s sorta 2 questions being asked: what should we use if we’re learning, and what should we use if we want to make a plugin to sell. I’m not a professional plugin dev but I do work in game audio, so I feel like I’m positioned to answer both:
To learn, you’re most concerned with simplicity and iteration time. If you’re unfamiliar with DSP in general, I would recommend skipping the whole plugin ecosystem altogether, and build a simple wave processor, where you take a wave file in, do your effect processing, and output a new file. You don’t need to do this in C/C++ or Zig, I started with Matlab and Max MSP, and found them both to be great learning environments because I was much less concerned with fiddling with allocation strategies and vectorization. That stuff is important for writing high quality audio software, but it comes after the basics.
Now for “professional” plugin development. The main difference between plugin standards is market share, not feature sets (people will quibble, yes there are significant differences, for example sample accurate parameter control). The idea that standards like LV2/CLAP are not “serious” standards, or that they are somehow worse for real time processing is just untrue. At the end of the day, you are being provided with a block of samples to fill, and either some midi data or a block of samples as input, whether you are able to do your processing in realtime is a function of your code, not the plugin format. To get back to market share here are who uses which plugin formats:
- AAX: only format supported by ProTools (“industry standard” especially in recorded music settings. That’s changing, but slowly)
- AU: only format supported by Logic (apple’s flagship DAW, lots of users)
- VST3: a proprietary format by Steinberg, supported by basically every major DAW, except the two above.
- VST: An ancient predecessor to VST3, support is being phased out but still has pretty wide support.
- LV2: A FOSS plugin format, supported by Reaper, and some others (Ardour I think?)
- CLAP: Another FOSS format, championed by U-He and Bitwig.
When choosing from these to make a commercial plugin, it’s really important to consider your target consumer. However, I would say that it is standard to support at least VST3/AU/AAX, as this will cover the vast majority of consumers.
Sorry for the long post, but hopefully this clears things up, and stops the bike shedding. Go make some cool effects!
CLAP is a relative newcomer, but shows great promise to escape the lock-in hegemony and control of the corporations. The plugin hosts are slowly adding support for CLAP, and there are good wrappers that make your plugin work for other formats.
Curious whether there have been many other VST projects built in Zig? I was looking at potentailly making an open source framework for audio plugins - for my own use / enjoyment - curious what’s out there in the community now!