如何在 Audiokit 的 frequency/pitch 上构建一个带有包络的振荡器?

How to build an oscillator with an envelope on its frequency/pitch in Audiokit?

我是 Audiokit 的新手,我尝试构建一个合成器,我可以在其中将 AD 包络路由到不同的参数,例如振荡器的频率等。 在我看来,似乎只能在 DSP 级别上解决这个问题。 I found out AKxxxOscillatorBanks 正在对音量进行 ADSR,我可能不得不使用这部分代码来 "apply this only to the pitch"。

所以看来我只需要编写一个 "new bank type that does the ADSR over other kinds of parameters" 脚本即可。因为我想完全控制频率并且只需要一个单声道振荡器,所以我只需要将 ADSR 包络实现到新版本的 AKMorphingOscillator 中,但我不知道从哪里开始。

我想我必须编辑

void run(int frameCount, float* outL, float* outR)

来自 AKMorphingOscillatorBankDSPKernel.hpp 并且看起来 ADSR 在 for 循环中工作,如

sp_adsr_compute(kernel->sp, adsr, &internalGate, &amp);
sp_oscmorph_compute(kernel->sp, osc, nil, &x);

但我的知识到此为止。任何帮助,将不胜感激。谢谢!

编辑:还在上面。也许 AKOperationGenerator 也可能是正确的方向,例如 this example.

看来这太复杂了或者方向完全错误。我停止了这个方法并继续 .