Building plugins: hints and tips for getting it all to work

The juce plugin directory contains a readme file describing how to build the many different permutations of platform/API that are possible. I’ve tried to make that contain everything you need to know, but this thread is a place to put any extra problems/fixes/hints/tips you might have come across…

Hi,

Let me start by sharing a little script :

Each time I download the tip for testing the JuceDemoPlugin, I have to change the path of jules’s computer for the 4 RTAS stuff (2 xconfig files , 1 plugin library file, and the MacBag).
So I run a little shell script that I run thru an automator application.

It read the xcode project and perform a ‘search and replace all’ action. i.e. in my case, it first looks for all occurences of ‘/Users/jules/SDKs/PT_80_SDK/’ and replace by my local path to the digi SDK. Then same for pluginlibrary path (wich on jules’s computer started with ‘/Users/jules/stuff/PT_73_SDK/’).

[code]-- change path for digiconfig debug & release , and mac bag
/usr/bin/sed -e ‘s//Users/jules/SDKs/PT_80_SDK///Users/tritonedigital/SDKs/PT_80_SDK//g’ “/juce/trunk/extras/audio plugins/demo/build/mac/JuceDemoPlugin.xcodeproj/project.pbxproj” > "/project.pbxproj"
mv “/project.pbxproj” “/juce/trunk/extras/audio plugins/demo/build/mac/JuceDemoPlugin.xcodeproj/project.pbxproj”

–change path for digi plugin library
/usr/bin/sed -e ‘s//Users/jules/stuff/PT_73_SDK///Users/tritonedigital/SDKs/PT_80_SDK//g’ “/juce/trunk/extras/audio plugins/demo/build/mac/JuceDemoPlugin.xcodeproj/project.pbxproj” > "/project.pbxproj"
mv “/project.pbxproj” “/juce/trunk/extras/audio plugins/demo/build/mac/JuceDemoPlugin.xcodeproj/project.pbxproj”[/code]

Certainly there is prettier way of doing it, but it do the work, and can be derived for various similar tasks. For using this script, you need to edit the path to your local digi sdk, and also the path to your local juce trunk/tag folder.

FWIW,

Salvator

Here’s a little newbie hint for those (like me) trying to get JuceDemoPlugin working for the first time on OSX.

I kept getting errors like:

juce_VST_Wrapper.cpp:66:52: error: public.sdk/source/vst2.x/audioeffectx.h: No such file or directory

My Xcode project was generated by the Jucer, and I had put the include path in the Jucer project’s XCode tab “VST Folder”.

The problem turned out to be that I had a space character in my VST SDK folder. When I renamed the folder to use a “_” instead, and updated the bit in the Jucer project, my JuceDemoPlugin build the VST ok.

HTH

I was getting a similar error in VS2008 when trying to build the demo:
fatal error C1083: Cannot open include file: ‘public.sdk/source/vst2.x/audioeffectx.h’: No such file or directory

I checked and made sure the file in fact does exist in that directory (it did). I wasn’t exactly sure if I was adding the path to the include directory the right way and I found the solution so I’ll post it here for other users new to this just as I am.

(Remember this is for VS2008, this may have changed for VS2010 and you’ll have to do your own grunt work to find the answers, sorry!)

  1. To add an include path locally (to the specific project):
    A. Right click on the project name (JuceDemoPlugin) in the Solution Explorer window. Select ‘Properties’.
    B. Under Configuration Properties>C/C++>General, there is a line “Additional Include Directories” where you can add/edit what already exists for include paths. This is where my compile problems came from. The path had an appended SDK directory which did not exist. Make sure you have the right path entered.

  2. To add an include path globally (to all projects opened in the IDE):
    A. Tools > Options > Projects and Solutions > VC++ Directories. Select “Include Files” from the “Show directories for” drop down box in the upper right hand corner.

Hope this helps!

I built the JuceDemoPlugin but read from the

"How to use this framework.txt" 

file that there is a header called

JucePluginCharacteristics.h 

containing some macros I could set. Does anyone have that file? It was not contained in my download.

Regards

[quote=“RASOKA”]I built the JuceDemoPlugin but read from the

"How to use this framework.txt" 

file that there is a header called

JucePluginCharacteristics.h 

containing some macros I could set. Does anyone have that file? It was not contained in my download.

Regards[/quote]

Sorry, that info is out-of-date - the introjucer now puts the definitions in the AppConfig.h file.

i am trying to build the juicedemo plugins in vs2010 but am having this error : :[color=#FF0000]users\easy\documents\juce\modules\juce_audio_plugin_client\vst\juce_vst_wrapper.cpp(76): fatal error C1083: Cannot open include file: ‘public.sdk/source/vst2.x/audioeffectx.h’: No such file or director[/color]y.

i have checked the vst folder and change the aeffectx.h to audioeffectx but am still having this error any recommendation

You’re not pointing to the vst2.4 directory correctly it looks like. You shouldn’t need to be renaming any files.

TIP: copying files between projects on Visual Studio

I have not updated completely to using the new Introjucer generated projects, but needed to get a release out, so I generated a test project so I could copy the new way things are built over to my old project. This works great on Mac but on Windows Visual Studio doesn’t allow copying of filter folders or files between instances. So I found a great workaround, that is open your old project inside the new solution, then copy the “Juce Library Code” filter to your old project, then quit, and the changes will be written to your old project which you can now open in your old solution again.

(edit: but you will still have to manually change the calling convention to stdcall for the rtas files since that info doesn’t get copied)

Hi, when I open the JuceDemoPlugin project in XCode, through Introjucer, and XCode finds three semantic issues for which it says: "Only virtual member function can be marked 'override'. Fix it: Replace 'override' with '' "

The issues are placed in juce_AU_Wrapper.mm, class JuceAUBaseClass. 

I'm on OSX 10.6.8, XCode 4.2

Since I'm following this tutorial http://bit.ly/1c950Yq, which is probably more expert on VisualBasic, could you give me any clue to fix it?

Thanks.

That's odd.. Even if you're running an old version of the compiler that doesn't support override, it shouldn't give any errors. Do you mean that all "override"s don't work, or just those particular ones?

put "override" between comment /**/, and the built succeded! Now I test the plugin in my host!

( I'm learning c++ ;-)

Thanks, but which instances of "override" are you talking about!? I build that code all the time in Xcode and have never had a problem..

These are the lines

class JuceAUBaseClass   : public AUMIDIEffectBase

{

public:

    JuceAUBaseClass (AudioComponentInstance comp)  : AUMIDIEffectBase (comp, false) {}

 

    OSStatus MIDIEvent (UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame) /*override*/

    {

        return AUMIDIBase::MIDIEvent (inStatus, inData1, inData2, inOffsetSampleFrame);

    }

 

    OSStatus SysEx (const UInt8* inData, UInt32 inLength) /*override*/

    {

        return AUMIDIBase::SysEx (inData, inLength);

    }

};

and here

ComponentResult StopNote (MusicDeviceGroupID, NoteInstanceID, UInt32) /*override*/   { return noErr; } 

Hope it can help! 

Ah! Thanks for the heads-up on that, I've sorted it out now!

The reason they snuck in there was that my test projects are synths, and it'll only be problem if you're building a non-synth effect.. doh!

I had some problems getting it to compile, but got it to work without knowing what i did wrong or right.  Works now.  Oh what a feeling!

I just checked out the tip and compiled the demo plugin. I got this error in juce_VST_Wrapper.cpp about the function VstInt32 canDo (char* text): Only virtual member functions can be marked 'override.' 

Would you be willing to turn on the 64-bit build by default in the demo plugin example? I just built it to diagnose a bug, but I needed the 64-bit version, and so I had to spend a while messing around with XCode's build settings and schemes to turn it on. 

If you're getting an error, maybe you're using an out-of-date VST SDK where that method signature is different?

Since the demo version can only really be 32 or 64 bits, I really don't want to make it 64 by default, as the number of posts from confused people whose plugin doesn't load in 32 bit hosts would go up enormously..

Sorry, ought to have mentioned I'm using the VST 2.4 SDK, same one since ages. Are you going to be requiring a newer one?

Why do you say the demo version can only be 32 or 64 bits? Building 32+64 seems to work fine once I set it up. 

I think they fixed some 64-bit issues in newer VST SDKs. For example in older SDKs that canDo method returned a long, but they later corrected it to return a 32-bit type.

Sorry, for some reason I assumed you were talking about a Windows build. I thought the OSX version was already doing a 32+64 bit build, but I'll check that.