Juce Diary P02: coding my first plugin

Discussion in 'Software' started by Xupito, Oct 20, 2020.

  1. Xupito

    Xupito Audiosexual

    Joined:
    Jan 21, 2012
    Messages:
    7,239
    Likes Received:
    3,997
    Location:
    Europe
    [FIRST PART HERE]
    After not sleeping last night I managed to code my first VST plugin. Hell yeah!
    Like in the first part I modified a simple Juce (C++ plugin framework) Midi example, but this time a plugin so I don't need external shit.
    My goal is to make a Midi VST tool that among other things uses my gamepad as a MIDI controller. It turns out you can access a gamepad from a plugin in your regular DAW. How cool is that? :disco:

    So I added a C++ gamepad library to access my gamepad and I mapped the X and Y axis of the left analog stick to the Midi pitch bend and volume respectively. So besides the regular MIDI incoming the plugin adds and mixes the input of the gamepad. Could be notes, keyswitches, other MIDI CCs, lots of potential. The original plugin is a Midi logger, fits well.

    I messed up the default volume orientation and didn't add a "dead zone" so sounds like shit (ie. like my brain feels now) but it'll be easy to correct that.

    DEMOOOOOOO


    The plugin is just a 1MB VST2 .dll
    I'm dying of sleep, going to nap until Justin Bieber writes a good song:rofl:
     
    Last edited: Oct 20, 2020
  2.  
  3. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    Did you continue?
     
  4. Xupito

    Xupito Audiosexual

    Joined:
    Jan 21, 2012
    Messages:
    7,239
    Likes Received:
    3,997
    Location:
    Europe
    Nopes, but I might if I find a way to compile quickly JUCE projects. I'm halfway there...
     
  5. clone

    clone Audiosexual

    Joined:
    Feb 5, 2021
    Messages:
    7,410
    Likes Received:
    3,261
    Have you done some prior programming, or did you just dive into this?
     
  6. Xupito

    Xupito Audiosexual

    Joined:
    Jan 21, 2012
    Messages:
    7,239
    Likes Received:
    3,997
    Location:
    Europe
    I did quite some C while in college. And a little Win98 C desktop app. Yeah, looong ago lol
    Then I started working as a web programmer and haven't touched desktop programming or C++. As a Web Developer I only use scripted languages Javascript-like, no GUIs so very different beasts. And SQL, the language for databases.

    Even so it took me like 2 weeks install Visual Studio 2019 and get the JUCE examples to compile. Not easy at all to program plugins in C++.
     
    Last edited: Mar 15, 2022
  7. ArticStorm

    ArticStorm Moderator Staff Member

    Joined:
    Jun 7, 2011
    Messages:
    7,710
    Likes Received:
    3,930
    Location:
    AudioSexPro
    haha same problem here and well compiler is faster if you get rid of juce components you dont need. you can edit the way how effective the compiler optimizes - thats in the projucer as setting. Other than that i am not aware of any optimization ideas.

    EDIT:
    Ohh this went super smooth in a few hours for me. The first plugin example took me another few hours to finally compile.

    But maybe JUCE has a better documentation now to get VS ready to compile as i did it last year.
     
    • Like Like x 1
    • Interesting Interesting x 1
    • List
  8. Xupito

    Xupito Audiosexual

    Joined:
    Jan 21, 2012
    Messages:
    7,239
    Likes Received:
    3,997
    Location:
    Europe
    Well done then :wink:. I don't remember what got me stuck. One part was trying to figure out what parts of visual studio I needed to install without eating a lot of GB.
    There's only two ways. One is using precompiled headers, which is half supported in JUCE recently. AFAIK only Visual Studio can do this.

    But the most effective is to compile a static library with all the Juce modules you need properly configured. You'll need more than one because there's a lot of settings that sometimes can't combine depending of the kind of project. But when you do that you almost only compile your changes. It's much faster but unless you know quite some Cmake is not easy to prepare. I'd need this cause my CPU is fucking slow in C++ compiling which needs a lot of cores/threads to go fast...

    That's while you develop, once is ready to go you do it the normal way to get rid of of unused things. And perhaps turn on Link Time Optimization.
     
Loading...
Similar Threads - Juce Diary coding Forum Date
Juce Diary: coding my first audio apps Software Dec 27, 2019
JUCE-based audio player? Software Jun 27, 2018
My Mojave Installs Diary on MacBook Pro Retina 2015. Mac / Hackintosh Jul 18, 2018
Fukushima Diary Lounge Jun 23, 2012
Loading...