VST Plugin Coding thread?

Discussion in 'Software' started by ArticStorm, May 28, 2021.

  1. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    Hey i thought it is a good idea to just start a topic in our beloved AudioSex Forum.

    I found a few good books on this and some youtube tutorial and i thought i share with you guys. Felt quite inspired by the Max4Live thing and wanted to go a level deeper. I guess it will anyway go not to far to actual code something useful lol. But maybe its good for people here, who knows?

    I will add everything later or maybe you have already some material to share? I will add everything later here, when we have a good list compiled.

    -------------------------------
    So what do we need:
    0. Baby steps - Stuff like Max4Live, Reaktor, etc helps to set the mindset.
    1. Math
    2. DSP
    3. Audio DSP
    3. C++ Books
    4. Frameworks
    5. Youtube +/-Tutorials
     
    • Like x 9
    • Winner x 5
    • Interesting x 3
    • Love it! x 3
    • Useful x 1
    • List
  2.  
  3. rollerball

    rollerball Platinum Record

    Joined:
    May 27, 2020
    Messages:
    288
    Likes Received:
    229
    I saw your share on the "sister site" and am eager to dive into it when I get the chance! I've wanted to mess around with programming plugins for a long time.
     
    • Like Like x 3
    • Love it! Love it! x 1
    • List
  4. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    it is similar here, i wanted to do it since like 2010, but you know 10+ years ago, it was so much more harder i guess? - i mean now, something like Juce with its tutorials, etc - Juce looks very good. And since im still stuck with Covid19 here - it was about time to do so.
     
  5. Ŧยχøя

    Ŧยχøя Audiosexual

    Joined:
    Dec 15, 2020
    Messages:
    1,098
    Likes Received:
    766
    Location:
    Neverland
    I've been trying to learn programing a VST myself, but I'm still a total Zero on the left,
    I need to learn more about C++ and coding in general before I will be able to really dig into Pirkle's book..

    Also I found it hard to find basic information like:
    How's the minimal fully-working plugin Structured,
    what Parts and Libraries must it include, etc..

    Examples of how to code the separate Components that could make a plug..
    You can find some stuff here and there, but it would be cool to have some sort of Compendium.

    Prikle's book seems to be the best possible resource tho,
    so I guess first one shall get his coding skills up to the book, and then pray..

    Pray to the holy mother of steep learning curve.. :D

    -Here's some useful links tho:
    VST3 SDK - https://new.steinberg.net/developers/
    VST3 SDK Documentation - https://steinbergmedia.github.io/vst3_doc/index.html
    Steinberg Dev forum - https://forums.steinberg.net/c/developer/103/none

    How to make VST plugins in Visual Studio:
    http://teragonaudio.com/article/How-to-make-VST-plugins-in-Visual-Studio.html

    Making Audio Plugins Tutorial:
    http://www.martin-finke.de/blog/tags/making_audio_plugins.html
    (the only good tutorial I could find,
    however I got stuck at some point due to it being outdated/newer software working differently..)

    iPlug 2 - C++ Audio Plug-in Framework - https://iplug2.github.io/

    The Scientist and Engineer's Guide to DSP:
    http://www.dspguide.com/pdfbook.htm

    Cockos WDL library - https://www.cockos.com/wdl/
    (don't ask me why but it seems it's used/well regarded by devs..)

    Easy Plugin making Platforms:
    https://rackafx.com/
    http://www.synthedit.com/

    Juce - https://juce.com/
    JUCE 4.x for VST Plugin Dev - http://www.redwoodaudio.net/Tutorials/juce_for_vst_development__intro.html
    Projucer Manual - https://juce.com/discover/stories/projucer-manual#6.1-juce-modules


    If anyone can find better starting material, or another proper/better Tutorial,
    please share it so we can all learn from it! :wink:
     
    Last edited: May 29, 2021
    • Like x 5
    • Useful x 3
    • Love it! x 2
    • Winner x 1
    • Interesting x 1
    • List
  6. Dalmation

    Dalmation Kapellmeister

    Joined:
    Jun 7, 2011
    Messages:
    494
    Likes Received:
    74
    • Like x 3
    • Agree x 1
    • Winner x 1
    • Love it! x 1
    • Useful x 1
    • List
  7. 1357

    1357 Noisemaker

    Joined:
    Jan 1, 2021
    Messages:
    6
    Likes Received:
    4
    someone should create a GitHub repo and start a project where we can fork it.
     
    Last edited: May 29, 2021
  8. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    • Like Like x 4
    • Interesting Interesting x 2
    • Useful Useful x 2
    • Winner Winner x 1
    • List
  9. alexgreggs

    alexgreggs Member

    Joined:
    Sep 30, 2015
    Messages:
    26
    Likes Received:
    14
    YES YES YES, I have been trying to get into this hard for the last few months and every forum was full of experts and couldn't understand anything. So this is a fantastic idea, CHEERS!!!
     
    • Like Like x 3
    • Love it! Love it! x 1
    • List
  10. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    • Winner Winner x 2
    • Interesting Interesting x 1
    • Useful Useful x 1
    • List
  11. Stevie Dude

    Stevie Dude Audiosexual

    Joined:
    Dec 29, 2020
    Messages:
    2,426
    Likes Received:
    2,188
    Location:
    Near Nyquist
    my teenage days (12-17) was filled with programming (Windows 95 days) but I part way with this world because my parents think it has no future (they are wrong, I know, but I forgive them already) and ask me to be some civil engineer or some shit, which I failed miserably because I was busy touring with my band. It (programming) is the first "thing" I fell in love with in my life, but it's already over for me and I moved on.

    Just want to wish good luck for any of you that want to try this thing out. Don't forget to share your work here so we can test it out!

    Start a Patreon or something and please don't add any lame protection whatsover, I'll put up post in request section in sister if I see one. lol. Good luck!
     
    Last edited: May 29, 2021
    • Like Like x 4
    • Interesting Interesting x 1
    • List
  12. junh1024

    junh1024 Rock Star

    Joined:
    Jul 28, 2011
    Messages:
    1,396
    Likes Received:
    433
    • Like Like x 2
    • Interesting Interesting x 1
    • List
  13. BEAT16

    BEAT16 Audiosexual

    Joined:
    May 24, 2012
    Messages:
    9,081
    Likes Received:
    7,006
    • Interesting Interesting x 4
    • Like Like x 1
    • List
  14. phumb-reh

    phumb-reh Guest

    For those who want to wade in instead of going straight into the deep end may I recommend these wrappers: JSFX for Reaper and BlueCat's Plug'n Script

    These let you concentrate on one aspect of plugin dev only (the processing code) which cuts down the barrier of entry, also the knowledge is transferable if you want to step up to native plugins with C++.

    Also for prototyping algorithms you can't beat JupyterLab, which lets you write code and visualise the results (with numpy/matplotlib) directly with no compilation phases/refreshes/plugin loadings inbetween. With xeus-cling you can directly write C++ though it can be a hassle to install.
     
    • Like Like x 3
    • Interesting Interesting x 3
    • Winner Winner x 1
    • List
  15. joem

    joem Producer

    Joined:
    Dec 17, 2011
    Messages:
    440
    Likes Received:
    124
    yea you needtolearn c plus plus i still have the vsti i made 13 years ago for collage it was a henry the hoover that made you guessed it hoovers, his eyes are the oscs and he nose was the detune knob
     
    Last edited: May 29, 2021
  16. phumb-reh

    phumb-reh Guest

    Not true this, you can use Delphi, Rust or C# and I'm sure there are other bindings. The GUI can be anything that can link to C code.
     
  17. Ŧยχøя

    Ŧยχøя Audiosexual

    Joined:
    Dec 15, 2020
    Messages:
    1,098
    Likes Received:
    766
    Location:
    Neverland
    I'm sorry, but this needs a little bit of clarification for half-brained, braying noobs like me..

    Because it seems regular VST plugs are made with C++, but then..:

    There's the JSFX plugins, which are different than VST, but use EEL2?

    Flowstone uses Ruby?

    And you say Delphi, Rust or C# can also be used..

    How is that possible?
    I mean, you could write/translate the same code in all those languages,
    put it into Visual Studio, and compile it to make a VST just as good?

    Or what's the difference between using one/another,
    aren't different languages necessarily linked to a specific Compiler, and need to adhere to a specific Structural layout?

    Is the VST standard compatible with all those languages?
    Doesn't it need to adhere to a very specific language and structural layout, namely C++?
    So why not learn, and approach it with C++ and that's it?

    Or is it like..
    It doesn't matter which Language you use, as long as it's Compiled in/from a Structurally compatible way/source,
    the plug will run relatively as good regardless..?


    -Are all Libraries and Frameworks (like iPlug2 or WDL) compatible with all languages and compilers?

    And how can one know which libraries to use, which ones are an absolute requirement, or could be handy,
    without opening and studying them inside-out one by one?

    And how can one know how to communicate with those libraries,
    do all libraries work the same, respond to a similar type of syntax/requests?

    What's the libraries usually used for, and what are they Not used for?
    What's the limits of what a library can do/give you?


    And what about Phyton which seems to be favored by most coders these days?
    Is it to slow for Audio DSP?

    How can one know what one doesn't know? :D


    I'm sorry if this is too Elemental, or seems like a step back, just trying a little bit of Socratic method here..
    But it's stuff like this that Experienced programmers Know and take for granted,
    but which noobs like me need to have clarified again and again at the beginning, until it clicks..

    What I would really need is a a series of Tutorials that I can follow Blindly,
    which take you from level 0, to being a plug programmer step by step..

    But yeah I don't think that exists, beyond things like the little Tutorial I linked on my first reply,
    or the awesome Prinkle Book, which covers the stuff up from a certain level of coding proficiency..
     
    Last edited: May 29, 2021
  18. r4e

    r4e Audiosexual

    Joined:
    Sep 6, 2014
    Messages:
    862
    Likes Received:
    1,228
    I already have a name for a potentially AudioSex VST Plugin: AudioSexToy
    ...ye, was a bad one

    What about a sub bass something called AudioSex Underwear VST?
    ...ye exactky, also stupid

    If anyone needs a GUI, I'd like to do it.
     
    • Funny Funny x 2
    • Like Like x 1
    • List
  19. phumb-reh

    phumb-reh Guest

    Ok, I'll try to answer.
    The VST SDK is C++ indeed, but anything that can link to it will work.
    They're different, EEL2 compiles to machine code which is then executed by the host. In this case it's Reaper, or the Reaper JSFX VST plugins. So the execution of the code is handled by those.
    I've not used Flowstone, but it seems to be a data manipulation framework. Useful perhaps for prototyping the audio manipulation code like Python/JupyterLab.
    Ok, here perhaps a clarification is needed. A plugin is basically composed of three elements:

    First there's the plugin code that actually processes the audio. It also maintains the GUI (but see below).

    Then there's the runtime which is handled by the host, it sends the audio to the plugin and passes the received audio onwards. It also deals with sending and sending MIDI/event data to the plugin, and constructs a basic GUI if needed (like Airwindows plugins don't have their own interfaces etc.).

    Third, there's the libraries linked to the plugin. Technically they're part of the plugin, but they could be external libraries (DLLs, so:s and dylibs)
    VST is a standard, yes. It defines an API which the plugin needs to respond to, exactly. The VST host dynamically links the plugin and if it doesn't respond to. This is defined by Steinberg in C++.

    However any code that can be compiled to respond to these API calls will work. this is called FFI (Foreign Function Interface), which is C code and it enables code written in several languages to talk to each other. For instance, it's possible to embed libraries written in C or C++ in Python via this mechanism. Examples are things like numpy.
    C++ is hard and very beginner unfriendly, and you also have to learn the tooling (compilation, linking etc.) which means you most likely have to deal with CMake which is another very big swamp initially. Also if you use external libraries you should be able to handle those as well. The plugin frameworks are helpful here, but more often than not you have to go outside those and then deal with the dependencies.
    They're compatible if there are bindings (code that bridges two programming languages together).

    Plugin framework libraries basically abstract the mechanics of host APIs to a single interface. For instance iPlug2 presents a unified programming interface and can compile to Audio Units and VSTs alike.

    But for instance that framework interface varies a bit, JUCE and iPlug2 are not compatible. But they do similar things so your actual DSP code will work with both with minimal changes. UIs are written completely differently.
    Python is not really geared up to low latency multithreaded operation, it's not fast as such. All of the "fast" Python code relies on libraries written in C/C++ and so on. If you want to geek out look up GIL (Global Interpreter Lock)

    Python, however, is fantastic for quickly prototyping DSP and UI code as you can edit the code and visualize it without any recompilation. Again, I'll mention JupyterLab.

    Here's an example w/ Jupyter:
    [​IMG]
    How does one learn? Reading docs and very importantly asking questions! We all have to start somewhere and nobody knows everything, se it's a learning experience for all of us.
     
    • Like Like x 1
    • Love it! Love it! x 1
    • Useful Useful x 1
    • List
  20. phumb-reh

    phumb-reh Guest

    A quick side note, since we're dealing with low-level data when creating plugins using C++ you have to be aware of C. Pointers, pointers to pointers, typedefs, null terminated strings, and all sorts of nasty shit.

    So if you want to learn C++ start with "modern C++" which is to say C++11 standard onwards, but you have to be comfortable with some C things. And oh, C++ and C are not the same, don't ever fall to that trap.

    The best free resource for learning C++ is LearnCPP and I'd recommend using exercises from HackerRank or Project Euler.

    Feel free to ask if you need help setting up a development environment (IDE/editor, compiler, build tools and so on). LearnCPP has a section for these as well.

    *edit*: https://en.cppreference.com/w/ is a must bookmark, stash it under your pillow, now.
     
    Last edited by a moderator: May 29, 2021
    • Like Like x 5
    • Agree Agree x 1
    • List
  21. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    Actual setting up VSC19 (Community version for free) was straight forward. only problem for me was opening reaper direct from VSC19.

    im using Juce+VSC19+VST3SDK(directly from git) and Reaper 6.29 for checking the plugin, wow reaper is damn fast for opening.

    i have doen some basic C++ tut so far from here: https://www.programiz.com/cpp-programming and for more detailed information about specific C++ things.
    http://www.cplusplus.com

    (actual its helpful to have learned other languages, for example i have python, APL basics, F95, a tiny bit haskell, SQL, bit Lisp, can read Assembly)
    It makes it much easier to understand basic concepts.

    then i came up with my own easy examples, like for If-else (and elseif):

    like if number is bigger than 50, then print blabla, else print bingo, elseif number equal 10, do this.

    same with the other loops.
    think i stopped with C++ functions.
     
Loading...
Similar Threads - Plugin Coding thread Forum Date
Plugins to emulate the effects of lossy encoding ? Software Dec 1, 2023
Juce Diary P02: coding my first plugin Software Oct 20, 2020
Vinyl Mastering Plugins Mixing and Mastering Saturday at 12:58 PM
Guys how do i fix the plugin database to go back to normal FL Studio Thursday at 11:11 PM
Deleting plugins crashing FL Studio? FL Studio Thursday at 10:51 PM
Loading...