voices.at(i)->setGain(1);
voices.at(i)->keyOff(0);
}
+
+ reverb.setT60(2);
+ reverb.setEffectMix(0.35);
+ mMasterGain = 0.85;
+
+ audio::Output::play(audio::createCallback(this, &iosynthApp::processAudio));
}
void iosynthApp::update()
}
}
+void iosynthApp::processAudio( uint64_t inSampleOffset, uint32_t ioSampleCount, audio::Buffer32f *ioBuffer ) {
+
+ for( int i = 0; i < ioSampleCount; i++ ) {
+
+ float sample = 0;
+
+ // render each voice
+ for (auto v : voices) {
+ sample += v->tick();
+ }
+
+ // delay line
+ sample += maxiDelay.dl(sample, 2048 * 8, .6); // * 0.9125;
+
+ // filter
+ // sample += maxiFilter.cutoff
+
+ // master reverb
+ sample = reverb.tick(sample);
+
+ // gate
+ // sample = fmin(sample, 1);
+
+ // master gain
+ sample = sample * mMasterGain;
+
+
+ ioBuffer->mData[i * ioBuffer->mNumberChannels] = mAudioSamples[0][i] = sample;
+ ioBuffer->mData[i * ioBuffer->mNumberChannels + 1] = mAudioSamples[1][i] = sample;
+ }
+}
+
+
void iosynthApp::mouseDown( MouseEvent event )
{
}
void update();
void draw();
- void processAudio( uint64_t inSampleOffset, uint32_t ioSampleCount,
- audio::Buffer32f *ioBuffer );
+ void processAudio( uint64_t inSampleOffset, uint32_t ioSampleCount, audio::Buffer32f *ioBuffer );
void touchesBegan( TouchEvent event );
void touchesMoved( TouchEvent event );
void touchesEnded( TouchEvent event );