尽管您的问题非常广泛,但我可以对从哪里开始提供一些见解。
首先,您需要一份Steinberg的VST3 SDK副本
根据我的经验,开始使用 VST SDK 有相当长的学习曲线。因此,我建议找到一个在其之上提供包装器的库。例如聚思
使用包装器将帮助您克服许多需要完成以使 VST 工作的样板编程。
至于波形生成、滤波和其他与 DSP 相关的概念……这里的主题太多了,我什至无法开始描述它。
查看musicdsp和The STK了解一些基本概念。
找一本关于这个主题的书。经典将是The Audio Programming Book
此外,您需要确保您对音频理论有很强的掌握。看看计算机音乐简介:第一卷。
当然,谷歌是你的朋友。
编辑:
更完整地回答你的问题。是的,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;
}
(从我的一个示例文件中提取)
如果您想在其他地方与我联系,我很乐意为您详细解释。(Stack Overflow 上不允许就该主题进行长时间讨论)