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

冷暖自知 提交于 2019-12-23 15:26:43

问题


I am new to Audiokit and I try to build a synth where I can route an AD-Envelope to different parameters, like frequency of an oscillator etc. To me it seems that it only is possible to solve this on a DSP level. I found out that the AKxxxOscillatorBanks are ADSR'ing the volume and I might have to use this part of code to "apply this only to the pitch".

So it seems that I just have to script a "new bank type that does the ADSR over other kinds of parameters". As I want to have full controll over the frequency and only need a monophonic oscillator I would onyl need to implement the ADSR envelope into a new version of AKMorphingOscillator, but I don't know where to start.

I think I would have to edit the

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

from AKMorphingOscillatorBankDSPKernel.hpp and there it looks like the ADSR works in the for-loop like

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

But thats where my knowledge stops. Any help would be appreciated. thnx!

edit: still on it. maybe the AKOperationGenerator could also be the right direction, like in this example.


回答1:


Seems that this would be too complicated or the complete wrong direction. I stopped this approch and went on with this one.



来源:https://stackoverflow.com/questions/49094157/how-to-build-an-oscillator-with-an-envelope-on-its-frequency-pitch-in-audiokit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!