如何使用 OSX/XCode 构建 VST 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1294695/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to build a VST-plugin with OSX/XCode
提问by bastibe
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.
我想在 OSX 上构建一个 VST 插件。我可以很好地编译它,但是 VST 主机(Cubase Essential 4)在尝试加载它时总是崩溃或报告插件以某种方式损坏。
可能,这是因为我缺少 VST 捆绑包的一些成分。
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?
需要在 XCode 中设置哪些首选项以及必须将哪些内容放入包中才能使其工作?或者某处甚至有一个示例项目?
Thank you in advance
先感谢您
回答by Nik Reiman
I have written up a guide for developing VST plugins by hand on Mac OSX here:
我在这里编写了在 Mac OSX 上手动开发 VST 插件的指南:
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:
我还开发了一组 Xcode 项目模板,您可以使用它们为您完成所有这些工作,并简单地为您提供 VST 效果/乐器的基础项目:
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.
这两个都是为 VST 2.x SDK 编写的,因为我没有使用 3.x SDK,也没有使用任何已经迁移到它的音序器。
回答by basteln
This guidecovers everything you asked and more.
本指南涵盖了您询问的所有内容以及更多内容。
回答by Alek
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.
我在网上搜索了有关如何使用 Xcode 构建 VST2 插件的完整指南,并找到了一些指南,尤其是 Nik 上一篇文章中的指南很有用,但其中缺少一些步骤(例如,Ableton Live 9.1.1 没有看到)没有步骤 3) 的插件,有些是多余的。所以我决定为最新的 Xcode 编写完整的指南。
Complete guide for creating optimized VST2 plugin using Xcode 5 on OSX
在 OSX 上使用 Xcode 5 创建优化的 VST2 插件的完整指南
- 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.hand again.cppfiles 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)
- 下载VST SDK,可以是VST3 sdk(我是3.6),vst2.x文件夹还在。打开包装并放入文件夹
Documents/Xcode
,使其看起来Documents/Xcode/VST3 SDK
- 打开 Xcode。创建新项目
OSX -> Framework & Library -> Bundle
在对话框中选择 Cocoa Framework。 - 创建项目后,在信息选项卡中:
- 添加
Resource should be file-mapped
具有值的新键YES
- 添加
- 在构建设置选项卡中:
Deployment -> Deployment Location
-> 设置Yes
Deployment -> Deployment Postprocessing
-> 设置Yes
Deployment -> Installation Built Products Location
-> 设置/
Deployment -> Installation Directory
-> 设置/Library/Audio/Plug-Ins/VST
Packaging -> Wrapper Extension
-> 设置vst
Search Paths -> Header Search Paths
-> 添加"$(HOME)/Documents/Xcode/VST3 SDK"
带引号的路径,带recursive
标志
Menu -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Build Configuration
-> 设置Release
- 将 vst2.x 文件夹从
VST3 SDK/public.sdk/source/
项目树中拖出。在添加文件对话框中:- 取消勾选
Copy items into destination group's folder
- 查看
Create groups for any added folder
- 检查您的项目
Add to targets
- 取消勾选
- 为您的效果或乐器添加 .h 和 .cpp 文件。您可以简单地从 https://github.com/kn0ll/vst-2.4-xcode-examples添加again.h和again.cpp文件以进行检查。
- 按运行(它可能会警告 SDK 源代码中的不当类型转换 - 让 Xcode 修复它)
回答by Benjineer
The sample project at VST3 SDK/public.sdk/samples/vst/mac
could also be a good place to start.
示例项目VST3 SDK/public.sdk/samples/vst/mac
也可能是一个很好的起点。