AScustomWorks / AS

VCV Rack Modules
Other
114 stars 16 forks source link

Response re: the Fundamental issues Delay thread #11

Closed ndrspcfd closed 6 years ago

ndrspcfd commented 6 years ago

Hi, rather than clutter up Fundamental's issues with my half-baked delay implementation, which you expressed interest in, I'll paste it here and clutter up your issues instead - feel free to delete it of course... :)

So in my module's constructor, I create an instance of the stk delayA delay line:

long maxDelay = engineGetSampleRate() * MAX_DELAY_SECS;
delay = new stk::DelayA(0.5, maxDelay);

Then the module's step method is something like:

void DelBoy::step() {
    float len = /* get the delay length param value */
    float sig =  /* get the input value */
    sig = sig / 10.0001 + 0.5;
    outputs[SIGNAL_OUT].value = (delay->tick(sig) + delay->tapOut(len)) / 2.0;
}

(This is untested code, since I've edited it down a bit for simplicity. As you will be able to see, it lacks a feedback param too! But should be enough to get started with)

As for inclusion, I copied Stk.h, Stk.cpp, DelayA.h and DelayA.cpp into my plugin src/ folder and just needed #include "DelayA.h" in my module cpp file. I think that was it. If I was intending to release, of course, I hope I'd have a less offensively naive way of amalgamating the stk dependency.. :)

EDIT: Hey, great modules, BTW, thanks a lot for those! :)

AScustomWorks commented 6 years ago

Hehe, good! Already made the update with the fix as found on Fundamental delay v0.6.0, but I'll definitely will check this option. Thanks a lot!

ndrspcfd commented 6 years ago

I get the impression there's probably a ton of interesting and high-quality dsp code in the STK as yet un-utilised by plugin authors ;-)

AScustomWorks commented 6 years ago

Indeed, after v0.6 goes public I'll take a closer look to STK ;)