KVR Audio: News and info about Audio Plugins (Virtual Instruments and Virtual Effects) - VST Plugins, Audio Units (AU), AAX Plugins, Reason Rack Extensions, iOS Apps (iPhone and iPad), Android Audio Apps, Soundware and Pro Audio Hardware. Grizzly is a drum sampler with built in filters, effects and modulation. It was made for the 2006 KVR Developer Challenge together with Edward 'Cyan' Blake.
Welcome to 2018! A lot happened this past year - the most important of which being the 0.0.1 release of vst
on Crates.io.
If you know what you're looking for (e.g., if you came here from a Google search) and you're antsy to get into code, just go ahead and skip to the bits where we start coding. Or read the notes that I slaved away at writing. Up to you.
Video
A video of this content has been provided. If that's not your thing, you can always follow along with the text below instead.
C VST Plugin Tutorials. Teragon Audio's Developer Resources Gui: VSTGUI SourceForge page - Be sure you get v3.5 here, especially if you want to roll your own controls. Thread about VSTGUI at KVR Audio. Gui / Framework: IPlug - An open C platform independent framework for VST and AU audio plugins and GUIs.
About
vst
is a crate that implements the VST 2.4 specification by Steinberg. VSTs (Virtual Studio Technology) are audio plugins used in a variety of applications. Its basic features are as follows:
- MIDI input and output
- Effects processing
- Audio synthesis
If you're here from a Google search, chances are you already know this. You also probably know of other solutions like JUCE, DPlug, or wdl-ol. If you're thinking 'Oh boy! Finally, I can ditch C++ for Rust!' - I like your enthusiasm, but the vst
crate isn't quite there yet! It's not much of a framework, and instead just lets you interact with MIDI notes and an audio buffer. It also doesn't have proper UI support yet. But hey, it's 0.0.1 - give us some time.
You may have also stumbled on Joe Clay's excellent post, Writing an Audio Plugin in Rust. Their post and this post are similar, and I'll address that below.
vst2 or vst?
In Joe's aforementioned example, they use overdrivenpotato's vst2 crate. Unfortunately, this repository has been stagnant for quite some time due to having only one contributor.
vst
is a fork of the original vst2
source, with a community of developers and maintainers keeping the project active.
TL;DR, you'll want to use the vst
crate, and not the vst2
crate. It sounds counterintuitive, but just roll with it.
Disclaimer
I'm not a professional in the DSP field. Some of the stuff I do might not be best practice or the most efficient. However, I hope I'm qualified enough to make a 'getting started' tutorial. I hope you think the info I provide is valuable.
We'll be creating a monophonic white-noise generator. In layman's terms, we're going to create a thing that makes whooooooshhhh noises, and that thing can only make one noise at a time.
Let's get started. Set up a new project the same way you would for any other crate. Let's call our VST 'whisper', because of the whooshing noises.
Each one has their own strengths and weaknesses.However, choosing the right VST to fit with your production style is key.Each piano has its own timbre with each timbre being best suited for different production styles. Are you looking for the best piano VST plugins to use in your own productions?If so, you may quickly realize that there are seemingly endless choices when it comes to piano VST plugins. Cymatics free vocals. Jump straight to the free piano VST plugins section of this article -Best Piano VST Plugins: $69 USDMain Features:.
After that, we need to add our vst
dependency, as well as specify that our crate type is 'cdylib'. It should look like this:
Next, lets add some basic boilerplate code to get our minimal VST up and running.
If you don't really know what's going on right now, don't worry. Basically, we're implementing the Plugin
trait for our Whisper
struct. This Plugin
trait contains all the info we need to comply with the VST standard in a struct aptly named Info
.
Right now, we're filling in our Info
struct with mostly default options. But there's a lot of stuff we can change to tell our host what our plugin does and expects. We can find full options in the plugin.rs
file.
name
- The name of our plugin as aString
vendor
- The creator (e.g. company) of our plugin as aString
presets
- The number of presets as ani32
. We can safely ignore this for now, and if you don't know what a preset is, don't worry.inputs
- The number of audio inputs as ani32
. This has a default of2
(one for the left channel, one for the right). Since we're creating a synthesizer that requires no inputs, we'll set this to0
later.outputs
- The number of audio outputs as ani32
. This again has a default of2
. This makes sense for our application which will output stereo audio. If we were building a surround-sound white-noise-ear-blaster, we would want to change this.unique_id
- This is required, but kind of pointless.version
- pretty self explanatory. This is saved as an i32, but you can still do semantic versioning. For example, a value of0001
would be the equivalent of version0.0.0.1
.1234
would be the equivalent of version1.2.3.4
.category
- This is an enum that specifies the category of the plugin, which is used in some DAWs. We're making aCategory::Synth
, which means we're going to create an output. If we made aCategory::Effect
, we might process inputs and modify their buffer.initial_delay
,preset_chunks
,f64_precision
,silent_when_stopped
- don't worry about these right now!
Now that we know a little more about what we want to build, let's revisit our lib.rs
file.
If you're already familiar with VST hosts, and how to load plugins, feel free to skip this part.
We're going to need a way to test our VST plugins. It's not as easy as running cargo run
, though, because VSTs are .dll
s. They need to be run inside of a VST host. If you use a DAW (Digital Audio Workstation), chances are you already have a VST host. Ableton Live, FL Studio, and Logic are a few popular examples. If you already have a VST host, look in your use manual on how to add VSTs or VST search directories.
If you don't have a VST host, go ahead and use the aptly named VST host. I'm going to be using VST host for all future examples in this tutorial.
Building and loading our plugin
Believe it or not, we already have something we can compile and load into a host. Go ahead and build your project.
If all goes well, you should have a successful build. A file named whisper.dll
should be present in your target/debug
directory. This is our VST file.
Go ahead and open VST Host, and drag our whisper.dll
file onto the main window. It should look something like this.
A bit underwhelming? Well, it shouldn't be! You just created your first VST plugin in Rust. It doesn't do anything, but it loads!
Notice in VST Host that a single greenish node connects with the output. This is the (stereo) audio output, like we defined in our Info
struct.
Right now, our plugin does nothing. Let's change that, and create some white noise to fill our audio buffer.
Top vst 2019. Warning: What we're making can be loud, and right now, it won't be controlled by anything. It'll just be always on, which is a bit unpleasant. Turn your volume down before you forget.
Our Plugin
trait has a few other functions - the most notable being process
. This is where we'll do a bunch of stuff with our audio buffer.
White noise is another name for random noise. In other words, it's just a bunch of random samples from -1.0
to 1.0
. So to achieve white noise, we want to fill our AudioBuffer
with, well, random noise.
Let's take a look back at our lib.rs
file, and define a new function.
Let's build, compile, and load this new plugin. Prepare your ears for the deafening sound of.. nothing. Every sample is 0
! We're just outputting silence. Let's fix this.
Note: if you're getting a weird error compiling, make sure you close the plugin in whatever host you have it open in, as the file might not be overwritten due to it being in use.
Vst Plugin Developer Tutorial For Beginners
Rust doesn't have a random library built in, so we'll need to add another dependency. Let's modify our Cargo.toml
file to remedy this.
Now let's modify our main file to add random values from -1.0
to 1.0
to our buffer.
Notice the additional crate and use
statement at the top of the file.
You might be wondering what the weird math does.*output_sample = (random::<f32>() - 0.5f32) * 2f32;
looks weird, right? What's with the extra operations?
Well, our random
function gives us a number between 0.0
and 1.0
, instead of -1.0
and 1.0
like we want. By subtracting 0.5
and then multiplying by 2.0
, we can get our desired result.
Performance
This method is poorly optimized, due to calling the random
function for every sample. This tutorial won't delve into optimization, but if you want to look at a possible solution, check out this example.
When building other plugins, be sure to test and/or distribute your builds with the --release
flag. This turns on certain optimizations that will help your plugin be more performant, at the cost of longer build times.
If you build and test your synth now, you'll see that it outputs horrible white noise, all of the time. Most VST instruments respond to MIDI input, e.g. notes on a piano. Instead of having our instrument produce noise all the time, let's make it so it only produces noise when a note is pressed.
Note: If you're using VST Host, you can play MIDI notes by hooking up the MIDI node and playing notes on the keyboard (which can be enabled on the top bar).
Because our instrument is unpitched, we don't care about what note is playing. We just want to make sure sound is playing as long as there is a note being pressed. We can do this quite simply by adding 1 to a counter whenever we receive a note_on
event, and subtracting 1 from the counter whenever a note_off
event is received.
Note: White noise is unpitched. No matter what note plays, the waveform will look the same. That's not necessarily true for all synthesizers, so keep in mind that the following solution will not be appropriate for all instruments. Our solution is also not very robust and is prone to breaking if our VST Host doesn't perform perfectly. However, it's a good introduction to events.
We're making a big change to the code, but it'll be our last for now. Let's go through the whole thing, and document changes through comments.
Build and compile our code, and your plugin should work wonderfully. It'll only create the horrible harsh white-noise when a key is being held. We can also mash down a bunch of keys at once without stopping generating sound.
Please again note that this is a very rudimentary system, and it's very specific to our use case.
Hopefully by now you have a rough understanding of how to create VSTs and modify audio buffers in Rust. In the future, I hope to expound on certain subjects, like creating controls or creating effects.
The source code can be found on Github here.
If you find an issue with the above code, let me know. The best way is to open an issue on the example repository.
Thanks to:
Mathias Lengler for their fix regarding an unnecessary usage of
Cell
.Adolfo Ochagavía for their insight in adding the
--release
flag to cargo builds to further optimize code.Alex Zywicki for their fix for refactoring the code without the need for an input buffer.
If you're totally sold on building VSTs with Rust, check out the official Rust VST Telegram chat. We're a friendly community who are eager to advise new users and help maintain better code.
If you're coming from something like JUCE and miss the abstraction, check out my rsynth project. It helps abstract a lot of what we did in this tutorial with stuff like voice managers. Note that it's super-alpha-in-development-broken code and needs a lot of work, but at least check out the examples.
In the future, we'll create more complex applications, like a multi-voice tonal synth with band-limited sawtooth waves. We'll also explore how to create a minimal GUI within Rust VST using your host's built in controls.
You can reach me on Mozilla's Rust IRC at doomy
or _doomy
. You can also add me on telegram @piedoomy, where I'm most certain to respond.
Virtual studio technology (VST) is an audio plug-in software interface that integrates a software synthesizer and effects into digital audio workstations. It uses digital signal processing to simulate a traditional recording studio’s hardware in software.
There are both commercial and freeware versions of VST plug-ins available in the market.
Think of VST plugins as an affordable way of making your home studio sound like an expensive commercial studio setup.
- 10 Best Opto Compressor Plugins (VST,AU,AAX) For Transparent Sound
- The 15 Best Delay Plugins For Mixing (VST, AU, AAX)
- The 33 Best WAVES Plugins Of 2020
- 29 Best Sound Design VST Plugins In 2020
- 17 Best Free EQ VST Plugins
What are the Best Tools to Develop VST Plug-ins?
I have listed a couple of libraries and frameworks that can handle most of the coding required in developing VST plug-ins.
JUCE Cross-Platform C++ Library
It is supported by the following platforms: OSX, Windows, Linux, iOS, and Android. It is free for non-commercial releases, but the commercial license works our best. It also covers 64bit systems.
Pricing of its commercial license
- Commercial license for a single product – $521
- Commercial license for any number of products – $912
- Upgrade from single-product version to unlimited version – $455
Despite the cost of the license for retail releases, it is the only library/framework option for a 64bit cross-platform.
Watch this video on how to create an awesome distortion VST/AU Plug-in using C++ / JUCE Framework
SynthEdit
SynthEdit is a framework and a visual circuit design that allows you to create your own synths with only drag & drop without programming. Therefore giving you the flexibility of using your DSP algorithms inside the modules.
At the time of writing this the 64-bit version is in Alpha and its creator Jeff McClintock is working on the ability to exporting it to AU. It’s got a ton of community-produced modules and works great with the 32-bit version. It is soft on your wallet – goes for $70.
Check out this video how SynthEdit work –
FL SynthMaker
FL SynthMaker aka flowstone comes free with FL studio.
It has a straightforward drag-and-drop graphical interface and a wide range of components. You can use it to code modules and DSP in Ruby and comes with loads of examples to get started quickly and its ability to assist you in creating a prototype within a short time is a plus.
How Are VST Plugins Made
You’ll be required to source for information from different sources depending on what your specific goals are.
For beginners, before learning how to code VST plugins, I would advise you to check out these environments:
- SynthEdit, SynthMaker, Reaktor, Max/MSP, PureData
- CSound, SuperCollider, Bidule, Usine
These environments allow you to build something unique without having to write low-level code which most people find difficult to master. You’ll be required to know different areas, and if you already have some, then you’ll only require to fill in the gaps.
Check out this video to learn how to build and design your VST Plugin using JUCE
Audio Basics
Understanding sound and its properties are essential before embarking on the development of VST plug-ins. I have outlined a couple of online resources you should go through them:
Fundamentals of Digital Audio Processing
The Scientist and Engineer’s Guide to Audio Signal Processing
Discrete-time systems, sampling theorem, audio DSP, maths, psychoacoustics, sound analysis, and sound modeling.
Signals, Sound, and Sensation by William M. Harmann
The book got an introductory text on psychoacoustics and the readers on a journey through the mathematics of signal and processing from its beginnings.
- 6 Best Passive EQ VST Plugins of 2020 (SPL, UAD, Waves, IK Multimedia)
- Top 6 Spectrum Analyzer Plugins Of 2020 – Spectral Analysis Tools
- 37 Best FREE VST Compressor Plugins For Mixing & Mastering
- 11 Best Granulizer Plugins 2020 for a Future Sound Design
- 10 Best Noise Gate Plugins (VST,AU, AAX) of 2020
Programming
Many professional VST plugins available on the market have been written in C++.
There are also several other languages you can use, but each got their pros and cons.
Learning how to develop VST Plug-ins as you’re learning to program isn’t easy. I usually recommend learning how to program before starting to create VST plug-ins.
The Audio Programming Book by Richard Boulanger – This book comes highly recommended for those who want to learn audio plug-ins.
BasicSynth by Daniel Mitchell – This one shows you how to create a custom synthesize in software using C++ programming language.
For more further information about VST development, you should definitely check these resources:
Audio Software (VST Plugin) Development with Practical Application
JUCE framework for VST-plugin development
Maths
You should have some basic engineering mathematics such as linear algebra, complex analysis, among others. Visit this website to get practical algebra lessons: www.purplemath.com.
Digital Signal Processing
You must know what an FFT routine is and why it is useful. Advanced content focusing on audio will usually require you to have at least a conversational level of DSP understanding.
Check out these resources on DSP:
Online and Free:
The Scientist & Engineer’s Guide to Digital Signal Processing
Print:
Understanding Digital Signal Processing by Richard G. Lyons
Audio Digital Signal Processing
Audio DSP extends on core DSP concepts to include the way digital signal processes apply to digital audio. It covers subjects such as audio filters, delays, and non-linear effects; think compression.
DAFX by Udo Zolzer is a book that comes highly recommended and covers many aspects of audio DSP technique.
Check out these online resources to get more info:
DSP Audio Classics
DSP Audio Algorithm Notes by XOXOS
Below are threads on VST Plug-ins I found from a couple of online discussion forums:
The AmpliTube Custom Shop is their free offering of their renowned AmpliTube range of guitar VSTs. Loaded with 24 pieces of gear to get you up and running, which include a digital chromatic tuner, 9 stompboxes, 4 amps, 5 cab models, 3 mics and 2 rack effects units. Best free overdrive VST: Mercuriall Tube Screamer 808. Meet the Mercuriall Tube Screamer 808 – your new overdrive VST effect plugin. It’s modeled after the holy grail of tube screamers: the Ibanez TS-808 pedal. Make your guitar sounds grungier. Flip between the TS-808 and MOD modes with the metal switch. MOD will give you a slightly. Amp VST Effect With Bite British Valve Custom from Studio Devil is a free tube amp modeller based on the gain structure of the popular British Valve Rock amplifiers -like the infamous Marshall tube heads. This amplifier plugin has a lot of bite and attack making it perfect for classic rock and hard rock sounds. Best guitar plugins free.
Advice for someone with ZERO experience
Developing a Vst Effect Plugin Where To Start?
What is your development setup?
Books
I have listed some books that can serve as a resource in your pursuit of learning how to make VST plug-ins.
Check them here:
Designing Software Synthesizer Plug-Ins in C++: For RackAFX, VST3, and Audio Units
Audio Plug-ins frameworks
Free Trap Vst Plugins
JUCE
JUCE is a highly recommended and all-encompassing C++ class library for developing cross-platform software. JUCE includes components for VST, AU, and RTAS. You should have at least a basic grasp of JUCE if you intend to use C++ for the development of your VST plug-in.
IPlug
This is a C++ framework for developing audio plug-ins and GUIs.
VST.NET
It allows VST Plugin developers to write Plugins in any .NET language. It also eases the transition between the C++ and .NET world and its framework built on top of the interop layer provide a clear and structured architecture. Feel free to check this Delphi library for creating VST plugins, VST hosts but also ASIO applications:
Delphi ASIO and VST
It also includes the algorithm for filters and dynamics.
- The 6 Best Ring Modulator VST Plugins in 2020 | KiloHearts, Melda
- 7 Best Vari-Mu Compressor Plugins of 2020 | Arturia, Manley, IK Multimedia
- 7 Best Autopan VST Plugins 2020 | CableGuys, Melda, Waves, Soundtoys
- The 6 Best Frequency Shifter VST Plugins Of 2020
What is the best programming language for the VST plugin?
C++ is one of the best programming languages for creating VST Plug-ins, and the reason for this is that C++ has a wide range of frameworks and libraries that work so well in creating VSTs. Read more What’s the Best Way How To learn C++?
The WDL-OL library makes C++ an attractive programming language for VST plugins because it helps you with the following:
- Creating multiple formats (VST, AudioUnit, VST3, and RTAS) from one codebase: Just choose the plugin format and click “run.”
- Create both 32-Bit and 64-Bit executables.
- Run your plugin as a standalone application (Windows or Mac). It means you don’t technically need a DAW to use the plugin.
- Most GUI controls used in audio plugins (knobs, buttons, visuals).
Free Vst Plugins Download
Understanding what VST Plugins are and their role within the music production industry provides you with the knowledge of identifying the most effective tools for your music production outfit. It makes your music sound like it was produced in a million-dollar music studio.