VST Plugin Coding thread?

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

  1. lbnv

    lbnv Platinum Record

    Joined:
    Nov 19, 2017
    Messages:
    409
    Likes Received:
    224
    • Like Like x 1
    • Winner Winner x 1
    • List
  2. ITHertz

    ITHertz Kapellmeister

    Joined:
    Dec 10, 2016
    Messages:
    63
    Likes Received:
    50
    Hi All,

    Thought I'd chip in with my 2c worth. I initially studied music, then music technology during which time I found that I had a knack for programming. I then worked in programming (various roles using C/C++ including supercomputing) for a number of years before moving into audio post which is what I'm currently doing.

    Developing audio plug-ins, like any software development, is quite complicated! In my experience there's two different things involved:

    1. Audio DSP
    2. Programming Tools (a) language, (b) build tools, (c) libraries, etc.

    People easily spend whole careers (and lives!) becoming experts in either of the above, and even in smaller sub-areas of each. Don't forget too that DSP is maths and depending on what you're doing, the maths can be quite advanced - i.e. calculus, differential equations, complex numbers, etc.

    And then there's the programming. For prototyping ideas, you can get away with using something like Python (non-real-time), but for real-time audio the code needs to run fast so you're most likely going to be looking at C or C++. I would tend to use C for anything that needs to run fast, whereas C++ is more useful an organisational tool (this is a gross generalisation so take it with a grain of salt!).

    Then there are your tools - as has been mentioned there are lots. Start with an IDE - I'm on macOS so Xcode is what I'd be looking at. Or you can go with a cross-platform IDE like Code Blocks or QT Creator. Another approach is to use something like CMake but then you'll need a separate editor for code development.

    And then there are the various libraries and SDKs that you'll need like VST or JUCE. I would recommend sticking with something that's well-supported and has somewhere where you can ask questions. Remember that a lot of this stuff has poor documentation (or none) so you'll need to be able to look at code and error messages and figure out what's going on yourself. That's often hard! Be prepared for lots of head-scratching when projects don't build due to some obscure link error or the like.

    Something that hasn't been mentioned as much is that you can learn a lot by looking at other people's source code. So find an established project and start combing through it. Even better, fork it and start improving it. (I forgot to mention that you'll most likely need to use some sort of version control software once you're underway).

    And I nearly forgot about GUIs - that's a whole other world of programming, particularly if you want things to be cross-platform. GUI SDKs could have improved in the time I've been out of the programming world? Also, remember that you can develop GUI-less plug-ins like the Airwindows ones.

    There are lots of programming books available and probably a lot have been released since I departed the world of programming. One that I thought was good is "Accelerated C++: Practical Programming by Example". I can explain why it's good if anyone is interested.

    And I'll finish with a cursory note of warning. A while back I thought I'd volunteer to help out with bug hunting on an open-source audio project (something like Ardour or Audacity). I'm on macOS but even to get either of these two projects to build was a complete nightmare which involved downloading and building masses of third-party libraries (e.g. GTKmm). Ultimately I couldn't get either to build even with the help of senior project developers - it simply required too much time.

    Anyway, that's my 2c. This is such a big topic that I've probably forgotten a lot of stuff. And I'm a bit out of the loop so some of the things I mention might be out of date.

    Cheers!
     
    • Like Like x 2
    • Winner Winner x 1
    • List
  3. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    For me maths is not the problem, how to put, its what im doing daily, on an advanced level and i have friends, who are also good at programming, with that i mean, know a lot of languages. The same goes for maths.

    Right now im studying convolution algebras with application to fourier transformation, complex analysis, real analysis i did a few years ago, i had numerical analysis basics with interpolation, solving differential equations with python, euler merhods, runge kutta methods, etc this really helps, because i guess lots of ppl bring fears from their school when dealing with maths in general and learn the basics from books - is very hard!

    I guess the really hard part is probably the programming for me, since i only had a few older programming languages. And i know a few basic methods, which help to get my head around.

    I am also interested in theoretical aspect of dsp development, meaning the maths.

    https://cytomic.com/technical-papers

    Also i think it is good to start with something like cycling74 max or reaper js - you name it. This really opens a gate to think in the way in which blocks audio applications are build.

    Welcome are all opinions and insights.

    @ITHertz wasnt C++ only an extension to C? and also some infix, postifx, etc shuffle on some things?
    Thanks for your extended insight.
     
  4. Tob

    Tob Platinum Record

    Joined:
    Jun 4, 2019
    Messages:
    304
    Likes Received:
    201
    you could say C is a subset of C++ or C++ is a superset of C.
    The syntax is really close/the same.
    The biggest difference is C is a function-driven language while C++ is an object-driven language (object oriented programming).
    Other things that come in to my mind are c does not have Reference variables or inheritance and exception handling.
     
  5. phumb-reh

    phumb-reh Guest

    This is wrong, modern C and modern C++ are not the same, if you want to learn C++ learn C++ not C.

    Here's a great talk about the subject
     
  6. BEAT16

    BEAT16 Audiosexual

    Joined:
    May 24, 2012
    Messages:
    9,081
    Likes Received:
    7,006
    Hello ArticStorm, there is a desire and interest, you are also not afraid of difficult programming. So you have good basic requirements. You have already tried it, which means your brain already knows it and that's where you get confidence. The brain wants to develop further, so it wants to have a task that you have already articulated.

    Now we are networked worldwide and have access to the collected Programming knowledge of the world. A we have more knowledge available B we are spoiled for choice. In contrast, only trial and error and the experience of many users worldwide can help.

    I still don't have a clear idea of a product from you - should it be a software synthesizer or an effect. We have already collected a few programming languages here and software, including open source, is very promising.
    A product should also represent added value, i.e. it should be able to do more than the Synthesizer X.
    You can also help develop and develop today, but this assumes that you have learned the profession and people usually have no time because they have to earn money - a paradox.- Waiting for the pension to come -

    You can also start something that others can then use - that would then be "Open Source" see GitHub.
    You can also download some things from GitHub that you can then develop yourself, provided you have decided on a programming language.
    Suggestion -> download SynthEdit - start and then say no, that's not fun or yes, that's it ...!

    SynthEdit - Build your own Synth (SynthEdit 1.4 (64-bit) Build 601 [03-Jun-2021]
    http://www.synthedit.com
    SDK version 3 Documentation
    http://www.synthedit.com/software-development-kit/sdk-version-3-documentation/
    https://www.musicdsp.org/en/latest/
    https://www.soundonsound.com/techniques/vst-diy
    ...........
    MF77 - FM Synthesizer with RCM (Wavetable)
    Unfortunately, that's why the project was never really finished. As a preliminary end product, there is a working VSTi plug-in. Unfortunately this is so power-hungry (due to the numerous live calculations) that most PCs do not allow smooth live play of the FM synthesizer.
    Since I will probably not get around to finishing the performance optimization for the synthesizer, I am making the project with all sources freely available here. Maybe there is one or the other programming enthusiast who can complete the project as a free project for the general public.
    https://www.fiedler-audio.de/mf77-fm-synthesizer-mit-rcm-wavetable/
     
    Last edited: Jun 6, 2021
  7. ITHertz

    ITHertz Kapellmeister

    Joined:
    Dec 10, 2016
    Messages:
    63
    Likes Received:
    50
    @ITHertz wasnt C++ only an extension to C? and also some infix, postifx, etc shuffle on some things?
    Thanks for your extended insight.[/QUOTE]

    Yes and no!!! When I first learnt programming I learnt C. It's actually a pretty simple language in terms of keywords, and being procedural it's really just a list of instructions that the computer steps through.

    C++ is different in that it's based on objects. In some ways, I think that learning C first means that I always tend to think in procedural terms - I see computing problems through the lens of C. C++, with its inheritance and encapsulation, means that in order to take advantage of its capabilities, you need to think in a different way. To really understand this problem you need to look into why C++ was created, and what problems it was trying to solve that were difficult or impossible in C. Having said that, you can write C-style code in C++, but if the "code police" find out you'll be arrested :rofl:

    If you just want to do audio plug-in programming then it's mostly going to be about the audio processing algorithm. Most of the object-oriented stuff will be taken care automagically by the API you use (like VST or JUCE). The GUI (if you choose to have one) will also be pretty straightforward if you can find some boilerplate code for the widgets you need (knobs, buttons, etc.).
     
    • Like Like x 1
    • Funny Funny x 1
    • List
  8. ITHertz

    ITHertz Kapellmeister

    Joined:
    Dec 10, 2016
    Messages:
    63
    Likes Received:
    50
    Forgot to mention too, that what I'd recommend is to download one of the free SDKs like VST or JUCE and build the examples that come with them. Then find an example that's close to what you want, study it and start modifying it. If you're lucky things will build straight out of the box. When you start adding stuff you're almost sure to run into errors - that's when the fun starts!
     
    • Agree Agree x 1
    • Love it! Love it! x 1
    • List
  9. Tob

    Tob Platinum Record

    Joined:
    Jun 4, 2019
    Messages:
    304
    Likes Received:
    201
    Well mate I am an "Ingenieur für Softwaretechnik" - yes a real German engineer before they change the education to B.sc and M.sc.
    C/C++ and python are my daily business :winker:. But thanks for that informative video.:yes:
     
  10. Hazen

    Hazen Rock Star

    Joined:
    Dec 28, 2016
    Messages:
    704
    Likes Received:
    410
    This is probably the best tutorial if you really wanna get hands-on from zero:

     
    • Like Like x 2
    • Agree Agree x 1
    • Interesting Interesting x 1
    • List
  11. Howard Carpendale

    Howard Carpendale Platinum Record

    Joined:
    Feb 2, 2021
    Messages:
    593
    Likes Received:
    247
    Location:
    .de
    5:03:46 part 1 intro :crazy::mad:
     
  12. BEAT16

    BEAT16 Audiosexual

    Joined:
    May 24, 2012
    Messages:
    9,081
    Likes Received:
    7,006
    Yes Howard, I see it the same way you do, I would rather make music. Just how much time is involved and for the brain that means stress to the power of ten ... either you are born as a programmer or as a musician? When the two come together, you are either a genius or an alien.

    Simple programming languages for beginners

    What is the easiest programming language for beginners? Which programming language should you use to learn programming? In the following article you will find specific recommendations and helpful tips on the most important selection criteria.
    Learning to program is a difficult and long journey. If you go hundreds of kilometers in the wrong direction, you will most likely break off the difficult journey and just sit on your couch. For this reason, you should calmly consider which programming language you want to start with.

    Are you looking for a programming language that is easy to learn?

    Two well-known programming languages are clear winners here, if you look, for example, at which programming courses are predominantly offered at American universities: Here the programming languages Python and Java are far ahead. This is followed by the programming language Matlab (best suited for mathematical matters), C and C ++. The latter two are increasingly being replaced by the Java programming language. Java, Python and JavaScript appear in almost all areas.

    While JavaScript is primarily aimed at web developers, Python and Java are suitable for almost any purpose. This allows the choice for beginners to be narrowed down significantly. Nevertheless, there are many other programming languages: If you are interested in web development, for example, you should first start with the important basics of CSS and HTML. To complete our overview, we will briefly introduce you to all the important programming languages:
    https://lerneprogrammieren.com/einfache-programmiersprachen-fuer-anfaenger/
     
  13. Xupito

    Xupito Audiosexual

    Joined:
    Jan 21, 2012
    Messages:
    7,239
    Likes Received:
    3,997
    Location:
    Europe
    Only 5:03? Just a quick teaser intro to watch while you're having your morning coffee :disco:
    Wait, is that HOURS?!?!?!?! :deep_facepalm::suicide:

    Edited: I was sarcasti-joking :rofl:
     
    Last edited: Jun 7, 2021
  14. Hazen

    Hazen Rock Star

    Joined:
    Dec 28, 2016
    Messages:
    704
    Likes Received:
    410
    Part 1 Intro is about 2 minutes 30 seconds if you look carefully. Yes, it's one long video, but it's partioned into multiple lessons. I would love to do the course, but I guess even if I would take it one lesson at a time, it's still too much for my attention span. So let's appreciate the people who do actually have the mental traits that allow them to code audio plugins. That's exactly why I like to support developers if I have the means available.
     
  15. BEAT16

    BEAT16 Audiosexual

    Joined:
    May 24, 2012
    Messages:
    9,081
    Likes Received:
    7,006
    Open-Source Audio Plugins & Apps
    https://github.com/webprofusion/OpenAudio

    Odin2 - Polyphonic Synth - Instrument - JUCE
    OwlBass - Additive bass synth - Instrument - JUCE
    OB-Xd - Based on the Oberheim OB-X - Instrument - JUCE
    Surge - Subtractive wavetable synth - Instrument - VSTGUI
    Vital - Spectral warping wavetable synthesizer - Instrument - JUCE
     
  16. Xupito

    Xupito Audiosexual

    Joined:
    Jan 21, 2012
    Messages:
    7,239
    Likes Received:
    3,997
    Location:
    Europe
    I agree. I was joking but didn't make it clear enough. My bad
    Definitely takes hours if you're not into C++/VST SDK/JUCE
    The other reference I was gonna add is the YT channel "The Audio Programmer" which has a lot of videos about JUCE and progresses even more slowly.
    Now has gone commercial but the videos are from 2018-2021 very roughly, so still very fresh and good shit.
     
  17. BEAT16

    BEAT16 Audiosexual

    Joined:
    May 24, 2012
    Messages:
    9,081
    Likes Received:
    7,006
    Say how much time it takes to learn that.
    And how many hours do you have to spend to program a synthesizer like the Vital, for example?
     
  18. Arabian_jesus

    Arabian_jesus Audiosexual

    Joined:
    Jul 2, 2019
    Messages:
    974
    Likes Received:
    758
    Did you work with programming audio software or just software in general? If so, is there any known plug-in/audio software developer you have worked for? Sorry for asking if you don't want to discuss it on this forum, I'm just curious :bleh:
     
  19. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    actual a C-kernel(very basic instruction set, to understand how a language works) will be taught here and then various variants of C, including C#,C++.

    Actual you can always extend a language by OOP ideas, like it was done with Fortran, which now has OOP ideas in the newest revision.

    also from wiki:
    from https://en.wikipedia.org/wiki/Compatibility_of_C_and_C++

    We never spoken about that they are same, but lets say C++ once originated from a C-fork.

    @BEAT16 Havnt decided yet, what kind of plugin i want to work on, maybe i will just focus on the DSP ideas, as the math is quite interesting and then try to get basics things to work here.
    maybe an interesting ideas drops out? I will see.
     
  20. Howard Carpendale

    Howard Carpendale Platinum Record

    Joined:
    Feb 2, 2021
    Messages:
    593
    Likes Received:
    247
    Location:
    .de
    Maach nee uff line vital version fueers erstee
     
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...