Hopefully @bozmillar might catch this next time he signs on. Or anyone else here that writes code
Does anyone know of a tutorial that would explain how to make a super basic VST or AU plugin? Like just something you could insert on a channel in Logic and cut and boost volume? Or something with one knob that can pan left to right?
I obviously donât need the plugin, but was more interested in seeing a sample of the entire code. And I was curious what GUI middleware engine you would build something like this in.
Why bother. Blue Catâs free suite incluydes what you want, thereâs a one control gain plug in there, and a stereo version too I think.
https://www.bluecataudio.com/Products/Bundle_FreewarePack/
Thanks Midge. I donât actually need it for audio purposes. I wanted to look at the data flow inside the code. So Iâm mainly interested in seeing how the plugin itself retrieves audio from the DAW, process it, then returns it to the DAW and sends it back down the signal chain. Then I wanted to try making some super basic edits to it (like maybe just changing the speed a which the fader moves and changing the color of a knob), then exporting the plugin, re-installign it, then seeing if I can get it to run properly.
So basically Iâm experimenting with scripting plugins. No intention of publishing any of them, but Iâd like to understand more about how they are designed.
1 Like
I had completely forgotten that Blue Cat runs on Mac. Thanks for the reminder. lol
Youâll want to start with a plugin framework. That will do most of the tedious work for you, to support the platformâMac OS and Windows, VST/AU/AAX. The most likely choices are JUCE or IPlug. There are other choicesâyou can even script a plugin in Reaper, if you just want to play with algorithms. But if you want to build a plugin for general distribution, supporting multiple plugin types and OSâs thatâs want youâll want.
In a nutshell, youâll code the user interface detailsâcreate your controls, and use the plugin framework to draw them when needed, and get their current settings. Then thereâs the audio threadâbasically, itâs running normally and does nothing, you override it to do your processing. Youâll get a buffer (or buffers for stereo, etc.), and youâll act on each sample. For a gain plugin, that means multiplying each value in the buffer by the gain indicated by your gain control.
âEtc.â
2 Likes
basically what earlevel said.
basically, on the part of the plugin that does the processing is a function that receives an array of samples. So your DAW will take 500 samples (or whatever size it wants to give you) and gives those samples to the plugin to process.
Each samples is a float or a double that ranges from -1 to +1. So if you want to apply gain, you just take your gain value (letâs say 6dB, which is 2x) and multiply each sample by that gain value.
so
process(*inBuffer, *outBuffer, bufferSize){
for(int i=0; i<bufferSize; i++){
outBuffer[i] = inBuffer[i] * 2;
}
}
1 Like