vst effect development using Xcode

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I recently got an iBook w/ OS X 10.3 and decided to try my hand at plug-in development once again. (I had dabbled with some success on Windows XP with Visual C++ 2003).

After downloading the Steinberg VST SDK 2.3, I was able to get the simple AGain plug-in to compile with no problems. It also worked flawlessly in my VST host, Ableton Live 3.0.4.

I took the 3 files that make up AGain, modified them to implement another simple algorithm, and attempted to create a new Xcode project with it. After some wrangling, I was able to get it to generate a package, but Live was never able to recognize it.

Has anyone been able to generate a new VST with Xcode from scratch? What settings did you use?

Any help would be appreciated.

-jason

Post

on the pc there is a .def file. Not sure about the mac, but this is the kind of thing that happens on pc projects if you lose the .def.

Post

No, you don't need a .def file on macs :wink:.

Personally, I'm really lazy about this - I just build all my plugins in the 'VST2.3Examples' example project, adding (duplicating) a new target for each new plugin.

Are you copying the compiled plugin to your /library/audio/plugins/vst/ folder? The example project has a small script to do this automatically, which might be why Live doesn't see your one. Other than that, all I can suggest is check that you're using the same build settings as the example project...

- Niall.

Post

Niall,
Thanks for the "copy target" suggestion - after a fair bit more wrangling (mostly my ignorance with Xcode) I was able to get my plugin to compile and work in Live. Thanks a ton!

This method, although a solution, doesn't feel satisfying. I wish i knew what process one could go through to set up a project properly instead of piggybacking.

thanks again! now to try and write something useful.

-jason

Post

Well, I had a play around with Project Builder and was able to create a project from scratch to compile AGain with :D . Here's what I did:

1.) Start a new project (Carbon bundle).
2.) Remove the main.c (Source) and InfoPlist.strings (Resources) files.
3.) In Targets->AGain->Settings, change the Installation Location Path to: $(HOME)/Library/Audio/Plug-Ins/VST/ (i.e. the folder you've got all your vst plugins in).
4.) Make the Prefix Header File: ../../vstsdk2.3/source/common/vstplugsmacho.h (or wherever you've got the vst headers stored - I think this is just to set a bunch of defines).
5.) In Search Paths, add the folder you've got the VST headers in to the Headers section.
6.) In Build Settings, change WRAPPER_EXTENSION to vst (on OSX, vst plugins have the extension .vst).
7.) Add a Shell Script Build Phase to Build Phases (Ctrl-click Build Phases->New Build Phase->New Shell Script Build Phase), and make sure the Shell Script is at the bottom of the build phase list.
8.) Add cp -r build/Gain.vst $HOME/Library/Audio/Plug-Ins/VST/ to the Script box (replacing Gain with the name of your plugin as defined in Settings->Product Name - this is so that your compiled plugin is copied to your plugin folder once it's been built).
9.) Add the plugin files and the VST files from the common folder to your project.

[edit]
10.) Create a blank file in the Resources group, call it PkgInfo, put BNDL???? in it and save.
11.) Like before, add another shell script to the build phases. This one goes before the other shell script in the list.
12.) For the new shell script, put cp PkgInfo build/Gain.vst/Contents/ in the Script box (to copy the PkgInfo file to your plugin folder, replace Gain with the name of your plugin).
[/edit]

13.) Build.

This is basically the bare minimum (I think) - if you wanted to add a gui I think you'd also have to include the ApplicationServices framework. You can also add things like copyrights, descriptions etc. in the Targets->Settings pane.

The only thing to note is that I'm using OSX v10.2, and the older version of XCode (when it was called Project Builder) - I shouldn't think it would make much difference, but some of the settings may have been moved for your version.

Good luck!

- Niall.
Last edited by NiallM on Tue May 18, 2004 4:40 pm, edited 1 time in total.

Post

Hmm - i've followed those directions, but i get no plugin.vst file... i do get a MacOS directory with a plugin file that finder identifies as a "unix executable" but does not function as a VST.

Post

:oops: That's a bit weird. There was a PkgInfo file in the Steinberg example project which I left out because I didn't know what it did, maybe you need that too :?: My process worked fine for Tracktion to be able to use the plugin though :? (admittedly, I didn't look at the resultant file in the finder). I'll take a look at it again this afternoon and see if I can work out what the problem is.

- Niall.

Post

i recommend reading dev docs regards bundles. VST plugins on Mac OS X (not CFM but Mach-O) are bundles - folder with defined structure. When PkgInfo is inside Contents folder, then bundle looks like file in Finder. Applications on OS X are also bundles, right/control-click on it in Finder and choose show package contents.

Post

What he said :wink: - that's why Tracktion was able to use my test plugin, even though you could see the plugin's contents in the finder. I've updated my previous post with the extra steps required to include PkgInfo.

- Niall.

Post

palec - thank you for the bundle insight. I would have been banging my head about for quite a bit on that one. I keep forgetting how much Mac OS X inherits from NeXTSTEP (.app directories, etc)

Niall,

Your directions are spot-on. I was able to get my simple plugin to work in ableton live. Would you mind if i edited your directions and posted them on my web server? I know i will use them for future projects, and i think having such a writeup public would be a service to a number of other plugin newbies.

one note - at least in ableton live, i had to have the "executable name" set to the plugin name WITHOUT the .vst extension. If the vst extension was present in that field, a bundle would be generated, but Ableton live would not recognize it.

Again, thank you both. I've had nothing but ill-will come in my direction from web-boards recently and its nice to find a community where people *gasp* help each other.

-jason

Post

I've got no problem with that :wink: .

- Niall.

Post

I've modified these directions for Xcode and Panther and posted them on my server. I hope someone finds it useful.

http://monkey.zombie-j.com/audio/vstxcode.html

Post Reply

Return to “DSP and Plugin Development”