如何使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:44:29  来源:igfitidea点击:

How to build a VST-plugin with OSX/XCode

xcodemacosvst

提问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

使用 Xcode 从头开始​​制作 VST 插件

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

Teragon Audio Xcode VST 模板

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 插件的完整指南

  1. 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/Xcodeso that it looks Documents/Xcode/VST3 SDK
  2. Open Xcode. Create New Project OSX -> Framework & Library -> BundleChoose Cocoa Framework in dialog.
  3. When the project is created, in Info tab:
    • Add new key Resource should be file-mappedwith value YES
  4. In Build Settings tab:
    • Deployment -> Deployment Location-> set Yes
    • Deployment -> Deployment Postprocessing-> set Yes
    • Deployment -> Installation Built Products Location-> set /
    • Deployment -> Installation Directory-> set /Library/Audio/Plug-Ins/VST
    • Packaging -> Wrapper Extension-> set vst
    • Search Paths -> Header Search Paths-> add path "$(HOME)/Documents/Xcode/VST3 SDK"with quotes, with recursiveflag
  5. Menu -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Build Configuration-> set Release
  6. 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
  7. 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.
  8. Press Run (it may warn about inappropriate typecast in SDK source - let Xcode fix it)
  1. 下载VST SDK,可以是VST3 sdk(我是3.6),vst2.x文件夹还在。打开包装并放入文件夹Documents/Xcode,使其看起来Documents/Xcode/VST3 SDK
  2. 打开 Xcode。创建新项目OSX -> Framework & Library -> Bundle在对话框中选择 Cocoa Framework。
  3. 创建项目后,在信息选项卡中:
    • 添加Resource should be file-mapped具有值的新键YES
  4. 在构建设置选项卡中:
    • 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标志
  5. Menu -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Build Configuration-> 设置 Release
  6. 将 vst2.x 文件夹从VST3 SDK/public.sdk/source/项目树中拖出。在添加文件对话框中:
    • 取消勾选 Copy items into destination group's folder
    • 查看 Create groups for any added folder
    • 检查您的项目 Add to targets
  7. 为您的效果或乐器添加 .h 和 .cpp 文件。您可以简单地从 https://github.com/kn0ll/vst-2.4-xcode-examples添加again.hagain.cpp文件以进行检查。
  8. 按运行(它可能会警告 SDK 源代码中的不当类型转换 - 让 Xcode 修复它)

回答by Benjineer

The sample project at VST3 SDK/public.sdk/samples/vst/maccould also be a good place to start.

示例项目VST3 SDK/public.sdk/samples/vst/mac也可能是一个很好的起点。