void process(AUAudioFrameCount frameCount, AUAudioFrameCount bufferOffset) override {

        for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) {

            int frameOffset = int(frameIndex + bufferOffset);

            centerFrequency = centerFrequencyRamper.getAndStep();
            fofilt->freq = (float)centerFrequency;
            attackDuration = attackDurationRamper.getAndStep();
            fofilt->atk = (float)attackDuration;
            decayDuration = decayDurationRamper.getAndStep();
            fofilt->dec = (float)decayDuration;

            for (int channel = 0; channel < channels; ++channel) {
                float *in  = (float *)inBufferListPtr->mBuffers[channel].mData  + frameOffset;
                float *out = (float *)outBufferListPtr->mBuffers[channel].mData + frameOffset;
                
                if (started) {
                    sp_fofilt_compute(sp, fofilt, in, out);
                } else {
                    *out = *in;
                }
            }
        }
    }
Esempio n. 2
0
void write_noise(sp_data *data, void *ud) {
    udata *udata = ud;
    SPFLOAT in = 0;
    SPFLOAT out = 0;
    sp_noise_compute(data, udata->ns, NULL, &in);
    sp_fofilt_compute(data, udata->tn, &in, &data->out[0]); 
}