Getting a VST Project set up in XCode

UPDATE: I actually found a webpage where this was explained really well so I setup my project in this manner too

This is for development with the Steinberg VST SDK v2.4 and NOT 3.0.

  1. Start a new project (Carbon bundle).
  2. Remove main.c, <PLUGIN_NAME>_Prefix.pch (Source) and InfoPlist.strings (Resources) files.
  3. Go to 'Project->Edit Active Target '<PLUGIN_NAME>'', and select the 'Build' tab.
  4. Point 'Header Search Paths' to the folder you've got the VST SDK in.
  5. Change 'Wrapper Extension' from bundle to vst.
  6. Change 'Installation Directory' to $(HOME)/Library/Audio/Plug-Ins/VST/, or wherever you want the plugin installed to.
  7. Create a blank text file in the 'Resources' section, put BNDL???? in it, and save it as PkgInfo. This is to make sure the OS X Finder sees the plugin as an actual executable, and not just another folder of stuff (which is what a bundle is, really).
  8. Go to 'Project->New Build Phase->New Run Script Build Phase', and make sure the shell script appears at the end of the list of phases in the 'Targets-><PLUGIN_NAME>' part of the 'Groups & Files' section. In the window that appears, put cp PkgInfo build/<PLUGIN_NAME>.vst/Contents/ in the Script editor. This is to make sure the PkgInfo file gets copied into the bundle.
  9. Add another shell script, the same way as before, again making sure it appears at the end of the list. In the window that appears, put cp -r build/<PLUGIN_NAME>.vst $HOME/Library/Audio/Plug-Ins/VST/ in the Script editor. This is is to copy the plugin over to your default plugins folder.
  10. Now, you have to create references to your source files and files belonging to the VST SDK. In the Groups and Files menu, right click on the Source folder and add (or create) the source files required for your project. From the VST SDK folder, add the files in the public.sdk/source/vst2.x and pluginterfaces/vst2.x folders to your project.

VSTGUI Notes

  1. Add the ApplicationServices and Quicktime frameworks.
  2. For any images you use, they must be named (i.e. the filename) very specifically:
  3. bmp<RESOURCE_NUM>.bmp

Where <RESOURCE_NUM> is the resource number you've assigned them in your VSTGUI editor. The other thing to note is that the resource number in the filename must consist of 5 digits, so if you had a resource number of 100, the filename would be: bmp00100.bmp. This all applies to .png images as well (i.e. they have to be named like bmp00100.png, not png00100.png).

Configurations/Build Styles Notes

  1. On the 'Build Results' window there's a drop down box named either 'Active Build Style' or 'Active Configuration', depending which version of XCode you're using. Setting this to Development means your plugin will be compiled with debug symbols etc. so you can debug it, while setting it to Deployment will compile it without debug symbols, and with optimisation. You can set which options apply to these build styles/configurations by ctrl-clicking the main project icon in the 'Groups & Files' section (it should be the first entry) and selecting 'Get Info'.

FFTW

If you have to do spectral domain analysis in your plugin, you'll have to use some FFT library. FFTW is one of the more popular ones and they claim to have the fastest implementation. It is open source. You can download it from the homepage and get it set up on your computer.

  1. In Xcode, you just need to specify where the user library and user include folders are. Go to Project -> Edit Active Target<PLUGIN_NAME>. In there, you should see a number of fields under search paths. Under the 'Header Search Path' add '/usr/local/include/' without quotes. Under the Library Search Path, add '/usr/local/lib'.
  2. Under Linking, go to Other Linker Flags and add the flag -lfftw3 .

Now you should be all set. Good luck!