| 62 | } |
| 63 | |
| 64 | void SynthVoice::renderNextBlock(AudioBuffer<float>& outputBuffer, int startSample, int numSamples) |
| 65 | { |
| 66 | for (int i = startSample; i < numSamples; i++) { |
| 67 | float value = 0.25f * mAmplitude * mADSR.getNextSample() * mOsc.processSample(0); |
| 68 | outputBuffer.addSample(0, i, value); |
| 69 | |
| 70 | if (!mADSR.isActive()) { |
| 71 | clearCurrentNote(); |
| 72 | return; |
| 73 | } |
| 74 | } |
| 75 | } |