虽然您的问题相当广泛,但我可以提供一些关于从哪里开始的见解。
首先,您需要一份来自 Steinberg 的 VST3 SDK 的副本
根据我的经验,开始使用 VST SDK 有相当长的学习曲线。因此,我建议找到一个在其之上提供包装器的库。例如JUCE
使用包装器将帮助您克服许多需要完成的样板编程以使 VST 工作。
至于波形生成、滤波和其他与 DSP 相关的概念......这里的主题太多了,我什至无法开始描述它。
查看musicdsp 和The STK 了解一些基本概念。
买一本关于这个主题的书。经典是The Audio Programming Book
此外,您还需要确保您对音频理论有很强的掌握。看看Introduction to Computer Music: Volume One。
当然,Google 是你的朋友。
编辑:
更完整地回答您的问题。是的,C++(或 C)将是此类应用程序的首选语言(尽管不是唯一可能的选择)
在深入研究 VST 开发之前,我会考虑使用音频 API,这将使您能够在没有 VST 开发的麻烦的情况下锻炼自己的技能。
至于音频库,有两个很受欢迎的选项:
假设您已安装 PortAudio 和 libzaudio,以下将生成一秒钟的 sin 440hz 波:
#include <iostream>
#include <cmath>
#include <libzaudio/zaudio.hpp>
int main(int argc, char** argv)
{
try
{
//bring the needed zaudio components into scope
using zaudio::no_error;
using zaudio::sample;
using zaudio::sample_format;
using zaudio::stream_params;
using zaudio::time_point;
using zaudio::make_stream_context;
using zaudio::make_stream_params;
using zaudio::make_audio_stream;
using zaudio::start_stream;
using zaudio::stop_stream;
using zaudio::thread_sleep;
//create an alias for a 32 bit float sample
using sample_type = sample<sample_format::f32>;
//create a stream context with the default api (portaudio currently)
auto&& context = make_stream_context<sample_type>();
//create a stream params object
auto&& params = make_stream_params<sample_type>(44100,512,0,2);
//setup to generate a sine wave
constexpr sample_type _2pi = M_PI * 2.0;
float hz = 440.0;
sample_type phs = 0;
sample_type stp = hz / params.sample_rate() * _2pi;
//create a zaudio::stream_callback compliant lambda that generates a sine wave
auto&& callback = [&](const sample_type* input,
sample_type* output,
time_point stream_time,
stream_params<sample_type>& params) noexcept
{
for(std::size_t i = 0; i < params.frame_count(); ++i)
{
for(std::size_t j = 0; j < params.output_frame_width(); ++j)
{
*(output++) = std::sin(phs);
}
phs += stp;
if(phs > _2pi)
{
phs -= _2pi;
}
}
return no_error;
};
//create an audio stream using the params, context, and callback created above. Uses the default error callback
auto&& stream = make_audio_stream<sample_type>(params,context,callback);
//start the stream
start_stream(stream);
//run for 1 second
thread_sleep(std::chrono::seconds(1));
//stop the stream
stop_stream(stream);
}
catch (std::exception& e)
{
std::cout<<e.what()<<std::endl;
}
return 0;
}
(Pulled from one of my example files)
如果您想在其他地方与我联系,我很乐意为您提供更详细的说明。 (Stack Overflow 上不允许就该主题进行长时间讨论)