C++ VST 插件是如何制作的?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2581025/
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-08-27 23:58:54  来源:igfitidea点击:

How are VST Plugins made?

c++audiovst

提问by jmasterx

I would like to make (or learn how to make) VST plugins. Is there a special SDK for this? how does one yield a .vst instead of a .exe? Also, if one is looking to make Audio Units for Logic Pro, how is that done? Thanks

我想制作(或学习如何制作)VST 插件。有专门的 SDK 吗?如何产生 .vst 而不是 .exe?另外,如果有人想为 Logic Pro 制作音频单元,那是怎么做的?谢谢

采纳答案by Development 4.0

Start with this linkto the wiki, explains what they are and gives links to the sdk. Here is some information regarding the deve

从这个wiki链接开始,解释它们是什么并提供指向 sdk 的链接。这里有一些关于开发的信息

How to compile a plugin - For making VST plugins in C++Builder, first you need the VST sdk by Steinberg. It's available from the Yvan Grabit's site (the link is at the top of the page).

如何编译插件 - 为了在 C++Builder 中制作 VST 插件,首先你需要 Steinberg 的 VST sdk。它可以从 Yvan Grabit 的网站上获得(链接位于页面顶部)。

The next thing you need to do is create a .def file (for example : myplugin.def). This needs to contain at least the following lines:

您需要做的下一件事是创建一个 .def 文件(例如:myplugin.def)。这至少需要包含以下几行:

EXPORTS main=_main

Borland compilers add an underscore to function names, and this exports the main()function the way a VST host expects it. For more information about .def files, see the C++Builder help files.

Borland 编译器为函数名称添加下划线,这会main()以 VST 主机期望的方式导出函数。有关 .def 文件的更多信息,请参阅 C++Builder 帮助文件。

This is not enough, though. If you're going to use any VCL element (anything to do with forms or components), you have to take care your plugin doesn't crash Cubase (or another VST host, for that matter). Here's how:

但这还不够。如果您打算使用任何 VCL 元素(与表单或组件有关的任何内容),您必须注意您的插件不会使 Cubase(或其他 VST 主机,就此而言)崩溃。就是这样:

  1. Include float.h.
  2. In the constructor of your effect class, write

    _control87(PC_64|MCW_EM,MCW_PC|MCW_EM);
    
  1. 包括 float.h。
  2. 在你的效果类的构造函数中,写

    _control87(PC_64|MCW_EM,MCW_PC|MCW_EM);
    

That should do the trick.

这应该够了吧。

Here are some more useful sites:

这里有一些更有用的网站:

http://www.steinberg.net/en/company/developer.html

http://www.steinberg.net/en/company/developer.html

how to write a vst plugin (pdf)via http://www.asktoby.com/#vsttutorial

如何通过http://www.asktoby.com/#vsttutorial编写 vst 插件 (pdf)

回答by basteln

I know this is 3 years old, but for everyone reading this now: Don't stick to VST, AU or any vendor's format. Steinberg has stopped supporting VST2, and people are in trouble porting their code to newer formats, because it's too tied to VST2.

我知道这已经 3 岁了,但对于现在阅读本文的每个人:不要坚持使用 VST、AU 或任何供应商的格式。Steinberg 已经停止支持 VST2,人们很难将他们的代码移植到更新的格式,因为它太依赖 VST2。

These tutorialscover creating plugins that run on Win/Mac, 32/64, all plugin formats from the same code base.

这些教程涵盖了创建在 Win/Mac 上运行的插件,32/64,来自相同代码库的所有插件格式。

回答by Nik Reiman

I wrote up a HOWTO for VST development on C++ with Visual Studioawhile back which details the steps necessary to create a basic plugin for the Windows platform (the Mac version of this article is forthcoming). On Windows, a VST plugin is just a normal DLL, but there are a number of "gotchas", and you need to build the plugin using some specific compiler/linker switches or else it won't be recognized by some hosts.

不久前,我写了一篇关于使用 Visual Studio 在 C++ 上进行 VST 开发HOWTO,其中详细介绍了为 Windows 平台创建基本插件所需的步骤(本文的 Mac 版本即将推出)。在 Windows 上,VST 插件只是一个普通的 DLL,但有许多“问题”,您需要使用一些特定的编译器/链接器开关来构建插件,否则某些主机将无法识别它。

As for the Mac, a VST plugin is just a bundle with the .vst extension, though there are also a few settings which must be configured correctly in order to generate a valid plugin. You can also download a set of Xcode VST plugin project templatesI made awhile back which can help you to write a working plugin on that platform.

对于 Mac,VST 插件只是带有 .vst 扩展名的捆绑包,但也必须正确配置一些设置才能生成有效插件。您还可以下载我不久前制作的一组Xcode VST 插件项目模板,它可以帮助您在该平台上编写工作插件。

As for AudioUnits, Apple has provided their own project templates which are included with Xcode. Apple also has very good tutorials and documentation online:

至于 AudioUnits,Apple 提供了他们自己的项目模板,这些模板包含在 Xcode 中。Apple 也有非常好的在线教程和文档:

I would also highly recommend checking out the Juce Framework, which has excellent support for creating cross-platform VST/AU plugins. If you're going open-source, then Juce is a no-brainer, but you will need to pay licensing fees for it if you plan on releasing your work without source code.

我还强烈建议您查看Juce Framework,它对创建跨平台 VST/AU 插件有很好的支持。如果您要开源,那么 Juce 是不费吹灰之力的,但如果您计划在没有源代码的情况下发布您的作品,则需要为此支付许可费。

回答by obiwanjacobi

If you know a .NET language (C#/VB.NET etc) then checkout VST.NET. This framework allows you to create (unmanaged) VST 2.4 plugins in .NET. It comes with a framework that structures and simplifies the creation of a VST Plugin with support for Parameters, Programs and Persistence.

如果您了解 .NET 语言(C#/VB.NET 等),请查看 VST.NET。此框架允许您在 .NET 中创建(非托管)VST 2.4 插件。它带有一个框架,该框架可构建并简化支持参数、程序和持久性的 VST 插件的创建。

There are several samples that demonstrate the typical plugin scenarios. There's also documentation that explains how to get started and some of the concepts behind VST.NET.

有几个示例演示了典型的插件场景。还有一些文档解释了如何开始以及 VST.NET 背后的一些概念。

Hope it helps. Marc Jacobi

希望能帮助到你。马克·雅可比

回答by user43633

I realize this is a very old post, but I have had success using the JUCE library, which builds projects for the major IDE's like Xcode, VS, and Codeblocks and automatically builds VST/3, AU/v3, RTAS, and AAX.

我意识到这是一篇很老的帖子,但我使用 JUCE 库取得了成功,该库为主要 IDE(如 Xcode、VS 和 Codeblocks)构建项目并自动构建 VST/3、AU/v3、RTAS 和 AAX。

https://www.juce.com/

https://www.juce.com/