desc:YeharMDCTBases // Version 0.1 // Written by Olli Niemitalo (o@iki.fi), 2016 // License: Do What the Fuck You Want to Public License. // // This effect separates sinusoidal, noise and transient // components of audio. It works on mono input so you need two // of these for stereo. @init function memAdd(dest, source, length) ( loop(length, dest[] = dest[] + source[]; dest += 1; source += 1; ); ); stepSize = 128; analysisSize = 512; nextStep = stepSize; inBuf = 0; // Length = analysisSize safety1 = inBuf+analysisSize; // Length = 1 tempBuf = safety1 + 1; // Length = analysisSize safety2 = tempBuf+analysisSize; // Length = 1 tempBuf2 = safety2+1; // Length = analysisSize accuBuf = tempBuf2 + analysisSize; // Length = analysisSize + stepSize step = 0; i = analysisSize; @sample i === analysisSize ? ( k = 0; loop(analysisSize/2, k === step ? ( tempBuf[k] = 1; ) : ( tempBuf[k] = 0; ); k += 1; ); imdct(tempBuf, analysisSize); i = 0; step += 1; ); spl0 = tempBuf[i]; spl1 = tempBuf[i]; i += 1;