How to build a VST-plugin with OSX/XCode
Question
I want to build a VST plugin on OSX. I can compile it just fine, but the VST-host (Cubase Essential 4) always crashes when trying to load it or reports that the plugin is somehow broken.
Probably, this is because I am missing some ingredients to the VST-bundle.
Which preferences need to be set in XCode and what stuff has to be put into the bundle to make this work? Or is there even a sample project somewhere?
Thank you in advance
Solution
I have written up a guide for developing VST plugins by hand on Mac OSX here:
Making a VST plugin from scratch with Xcode
Also I have developed a set of Xcode project templates which you can use which do all of this for you and simply give you a base project for VST effects/instruments:
Teragon Audio Xcode VST Templates
Both of these are written for the VST 2.x SDK, as I have not worked with the 3.x SDK and am not using any sequencers which have migrated to it yet.
OTHER TIPS
I searched the net looking for complete guide on how to build VST2 plugin using Xcode and found some guides, especially guide in previous post by Nik was useful, but some steps were missing in them (Ex. Ableton Live 9.1.1 doesn't see plugin without step 3), some were redundant. So I decided to write complete guide for most recent Xcode.
Complete guide for creating optimized VST2 plugin using Xcode 5 on OSX
- Download VST SDK, it can be VST3 sdk (3.6 in my case), vst2.x folder is still there. Unpack it and put to folder
Documents/Xcode
so that it looksDocuments/Xcode/VST3 SDK
- Open Xcode. Create New Project
OSX -> Framework & Library -> Bundle
Choose Cocoa Framework in dialog. - When the project is created, in Info tab:
- Add new key
Resource should be file-mapped
with valueYES
- Add new key
- In Build Settings tab:
Deployment -> Deployment Location
-> setYes
Deployment -> Deployment Postprocessing
-> setYes
Deployment -> Installation Built Products Location
-> set/
Deployment -> Installation Directory
-> set/Library/Audio/Plug-Ins/VST
Packaging -> Wrapper Extension
-> setvst
Search Paths -> Header Search Paths
-> add path"$(HOME)/Documents/Xcode/VST3 SDK"
with quotes, withrecursive
flag
Menu -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Build Configuration
-> setRelease
- Drag vst2.x folder from
VST3 SDK/public.sdk/source/
to project tree. In adding files dialog:- uncheck
Copy items into destination group's folder
- check
Create groups for any added folder
- check your project in
Add to targets
- uncheck
- Add your .h and .cpp files for your effect or instrument. You can simply add again.h and again.cpp files from https: //github.com/kn0ll/vst-2.4-xcode-examples just to check.
- Press Run (it may warn about inappropriate typecast in SDK source - let Xcode fix it)
This guide covers everything you asked and more.
The sample project at VST3 SDK/public.sdk/samples/vst/mac
could also be a good place to start.