Saturday 11 May 2013

Let's Build the JUCE Demo Plug-In

Before we actually make our own plug-in it might be wise to make sure we can build a plug-in successfully. To do this we can build the JUCE demo plug-in.

Take a look in 'JUCE/extras/audio plugin demo'. In there you should find a file called 'JuceDemoPlugin.jucer'. This is an Introjucer project file so open it up in The Introjucer. On the left you should see two tabs; 'Files' and 'Config'. Click on the 'Config' tab and you should see something like this.



This is where we tell The Introjucer what tools we want to use to build our project. If you want to add a new project (say you are using Visual Studio 2012), you can right click on the bit at the top where it says "Juce Demo Plugin". From there you can create projects for any of the IDEs JUCE currently supports.

Once you have a project exporter for the build tool you are using there is one thing you may need to change. Select whatever project you are going to be using on the left (I am going to select Visual Studio 2008). On the right you should now see something like this.


We need to tell our compiler where to look for the VST SDK files. We can do this by editing the VST Folder and VST3 Folder options. For bot put in the location of the 'VST3 SDK' folder you downloaded earlier. For We can then save the Introjucer project and it will update whichever project file we altered.

Now all you need to do is build the plug-in. This is done in the same way we built The Introjucer earlier.

Just a quick word of warning about the "Save Project and Open In ..." button in The Introjucer. If you have several project exports which use the same platform, such as the multiple Visual Studio Exporters shown above. This button will open the one highest up on the list. You may wish to delete the project exporters you don't need, or just drag the one you want to the top of the list.

You should now have a built plug-in hiding away somewhere. They will be in the same directories, relative to the project file, as the Introjucer executables were when we built them.

On Linux you should find a VST plug-in called 'JuceDemoPlugin.so'.

On Windows you should find a VST plug-in called 'JuceDemoPlugin.dll'.

I believe on Mac that the XCode project is set up to take the built plug-in files and install them to the system so they should appear in whatever plugin host you are using. It should have also built VST and AU versions of the plug-in.

Take this plug-in and load it up in whatever host you desire. If it works, Huzzah! You have just built a working audio plug-in from source. This means you are ready to delve into some source code and start making your own.

Have a nice day now!
Sean

P.S. There is actually a JUCE demo plugin host which is fairly nifty. You can find it in the extras folder of the JUCE download. I'm sure you can work out how to build it yourself. Have Fun!

12 comments:

  1. I've been following your tutorial but I have run into a problem. After I open the jucer file in Xcode and attempt to build it, I get the following error:

    "Member 'MIDIEvent' found in multiple base classes of different types"

    I am running OS 10.7.5 and Xcode 4.2.1

    Have you experienced this issue as well?

    ReplyDelete
    Replies
    1. Did you patch your Core Audio Files with the file given here?

      That should sort out the error. Unless Apple have changed things again.

      Delete
  2. Sorry to be a nag, but I am a complete noob at Juce. I'm an unsure how to "patch" the files. I just installed the latest Xcode and relocated my CoreAudio folder. I am not good at Debugging in Xcode but my newest error is "Rez Error ... failed with exit code 3".

    I really just need to get the demo working then I can poke around inside the 'processBlock' method to get my DSP going. Ultimately I am tying to create a 24-band filterbank, and some phase shifting all-pass filters for a 2-channel plugin.
    thanks

    ReplyDelete
    Replies
    1. I know little to nothing about Xcode myself.

      I would suggest doing a quick search on the JUCE forums. There are several thread on there dedicated to getting plug-ins built in Xcode.

      Sorry I can't be of more help.

      Delete
  3. Hello , mann thanks so much for these vst tutorials, I have a really quick question, how would I go about changing the actual design and using the toolbox in visual studio.. I bascially want to add components more buttons etc..??? Thanks

    ReplyDelete
    Replies
    1. There is actually a GUI editor built into The Introjucer. Under the Files tab, right click and select "Add New GUI Component...". Adding buttons and sliders and what have you is fairly intuitive.

      Actually integrating it into your project as the editor for your plug-in takes a bit of C++/JUCE knowledge. I do intend to write a tutorial about it at some point. Probably won't be for a fair while though I'm afraid.

      I do recall seeing that somebody on the JUCE forums made a version of the JUCE demo plugin which used the Introjucer's GUI editor. That might be a good thing for you to look at to get an idea of how it all fits together. When I get a bit of spare time later I'll see if I can find it and post a link.

      Delete
    2. I just went and found the link.

      http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=7680

      Unfortunately this is from a time when the GUI editor was a separate entity to the Introjucer. You should be able to import the file into the Introjucer project for the JUCE demo plug-in easily enough though.

      Hope that helps.

      Delete
  4. hi , i have just installed x code and have downloaded the JUCE repository files, i have run the introjucer project for x code but it will not let me open the introjucer app on my mac i am using X Code 3.2 with mac 10.68 ? any help ?

    ReplyDelete
    Replies
    1. Not sure, do you get any error messages telly you why you can't?

      Delete
  5. Hi, when I open the project in XCode, it finds three semantic errors for which it says: "Only virtual member function can be marked 'override'. Fix it: Replace 'override' with '' "
    The issues are in juce_AU_Wrapper.mm, class JuceAUBaseClass.

    ReplyDelete
    Replies
    1. I solved replacing the 'override' where indicated.

      Delete
  6. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. av installers toronto

    ReplyDelete