From iOS to VST

Hi there,

I’m a fair way through a sizable iOS project and was wondering if there was some smooth way to add VST capability.
The only way that comes to mind is to start a brand new Audio Plugin project (so as to get the projucer to generate the necessary file and build) and then manually relink the existing project into this new one.
Obviously this may be some work so I was wondering if there is a better way. If the alternative is to manually setup builds schemes etc. in Xcode then I guess starting from scratch really is the best way. If anyone experienced could help a man out and confirm this (possibly saving me a lot of time) it would be much appreciated.

To clarify, by VST capability I mean to make my app to be compatible with running as a VST plugin as well as an iOS app.

Many thanks,

Was that iOS project a JUCE project? In which case you can simply go to Projucer into the “Exporters” section (down left) and click the plus button to add a new exporter.

If your project is written directly in XCode for iOS, you will have to migrate manually the code, since the swift or objC code will not be available on VST’s for other platforms than OSX.

Hope that helps

Hi there it was a project made through the projucer - the standard GUI application template. I didn’t realize I could change GUI application to plugin - thanks for that.

Yes, you can do that. However, when changing the project type, it doesn’t create your boilerplate, since it cannot know, which parts to keep…

I would suggest to start a new plugin project, and move the code from the MainComponent into the generated that inherits AudioProcessorEditor (both inherit Component, so it shouldn’t have too many problems there)

The code from the AudioAppComponent, in getNextAudioBlock() goes into the processor.processBlock(). Here there are some differences, in how the function is called, but the processBlock is actually simpler.

The biggest adaptions are the AudioProcessorParameters, so the host can automate things in your plugin.
Also big caveat: the prepareToPlay of AudioAppComponent and AudioProcessor has the arguments reversed!

Ah yes I thought I could manually introduce these into the project but realize if it was somehow possible it would be nowhere near worth the effort. Thanks for your tips.

Since I have your attention could I bother you with another loosely-related question: I seem to be having some issues with setting up a plugin (i’ve done it before, but on windows, im on mac now). I have downloaded the VST3 sdk and globally pathed it but when building the juce example audio plugin host for debugging I’m getting an error “/juce_VST3Headers.h:98:11: fatal error: ‘pluginterfaces/vst/vsttypes.h’ file not found”

Also when building a new plugin template project from projucer I get a similar error

p.s. I’ve checked the the pluginterfaces/vst/ folder and it indeed has a vsttypes.h

My apologies, that’s the wrong error (it was from something else): the current error I’m getting is the following:

Undefined symbols for architecture x86_64:
“Steinberg::Vst::PlugInterfaceSupport::PlugInterfaceSupport()”, referenced from:
Steinberg::Vst::HostApplication::HostApplication() in include_juce_audio_processors.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ah yes, that was changed recently for both platforms. The VST headers, that were used back then needed to be removed in favour of a new VST3 only version. But that means, you don’t have to download the VST(3) SDK yourself.
It should work, if you remove all VST(legacy) and VST3_SDK paths from your project and your global settings.

I am surprised about a linker error though, it’s probably best to call additionally a project clean, just to be sure.

that was it - thanks again my man. When going through the “create a plugin part 1” tutorial I just read “Download and Install Dependencies” subtitle. When you said I don’t have to do it I thought I went crazy because “I read this somewhere”… Lo and behold if I just read the paragraph underneath the subtitle it actually says something like “no need to download and install anything!” haha… it’s late here in aus…

1 Like

I recently did something similar, porting a JUCE audio app to a plugin, and, if you don’t know the ins and outs of audio plugins (as I learnt along the way), there are a few things to keep in mind.

Be careful how you split your PluginProcessor and PluginEditor code:

  • Your editor will be destroyed and recreated whenever the host/user closes and reopens the plugin window, so only keep GUI related stuff in there. Everything else should go in the processor.
  • Make sure you remove any listeners in your editor destructor, as these will hang around and cause problems if you don’t!

I’m sure there are more but those were the main things I picked up.

1 Like

Thanks for the tips, I’m now second thinking my decision and will probably postpone this process until a later date. At least for now I have learned how I should structure project to make this process if and when I revisit it in the future.