leaf/Src/leaf-effects.c
// send one block of input samples, receive one block of output samples

send one block of input samples, receive one block of output samples
send one block of input samples receive one block of output samples
void tSOLAD_ioSamples(tSOLAD* const wp, float* in, float* out, int blocksize)
{
    _tSOLAD* w = *wp;
    int i = w->timeindex;
    int n = w->blocksize = blocksize;
    if(!i)
    {
        float sample = tHighpass_tick(&w->hp, in[0]);
        w->delaybuf[0] = sample;
        w->delaybuf[w->loopSize] = sample;   
        n--;
        i++;
        in++;
    }
    while(n--) w->delaybuf[i++] = tHighpass_tick(&w->hp, *in++);    
    tAttackDetection_setBlocksize(&w->ad, n);
    if (tAttackDetection_detect(&w->ad, in))
    {
        tSOLAD_setReadLag(wp, w->blocksize);
    }
    if(w->pitchfactor > 1) pitchup(w, out);
    else pitchdown(w, out);
    w->timeindex += blocksize;
    w->timeindex &= (w->loopSize - 1);
}
void tSOLAD_ioSamples ( tSOLAD * const wp , float * in , float * out , int blocksize ) { _tSOLAD * w = * wp ; int i = w -> timeindex ; int n = w -> blocksize = blocksize ; if ( ! i ) { float sample = tHighpass_tick ( & w -> hp , in [ 0 ] ) ; w -> delaybuf [ 0 ] = sample ; w -> delaybuf [ w -> loopSize ] = sample ; n -- ; i ++ ; in ++ ; } while ( n -- ) w -> delaybuf [ i ++ ] = tHighpass_tick ( & w -> hp , * in ++ ) ; tAttackDetection_setBlocksize ( & w -> ad , n ) ; if ( tAttackDetection_detect ( & w -> ad , in ) ) { tSOLAD_setReadLag ( wp , w -> blocksize ) ; } if ( w -> pitchfactor > 1 ) pitchup ( w , out ) ; else pitchdown ( w , out ) ; w -> timeindex += blocksize ; w -> timeindex &= ( w -> loopSize - 1 ) ; }
send one block of input samples, receive one block of output samples
send one block of input samples receive one block of output samples
// copy one sample for interpolation
 // copy one input block to delay buffer
