8 {P::Decay, [
this](
float x) {
setDecay(x); }, 0},
9 {P::Sustain, [
this](
float x) {
setSustain(x); }, 2},
10 {P::Release, [
this](
float x) {
setRelease(x); }, 0},
11 {P::Amount, [
this](
float x) {
setAmount(x); }, 0}});
18 m_adsr.setSampleRate(sampleRate);
21 m_buffer.setSize(1, samplesPerBlock);
27 auto numSamples = buffer.getNumSamples();
28 auto numChannels = buffer.getNumChannels();
29 auto bufferPtr = buffer.getArrayOfWritePointers();
31 auto modulatorBufferPtr =
m_buffer.getWritePointer(0);
36 for (
int sampleIndex = 0; sampleIndex < numSamples; sampleIndex++)
43 modulatorBufferPtr[sampleIndex] = 0.0f;
46 for (
int channelIndex = 0; channelIndex < numChannels; channelIndex++)
47 bufferPtr[channelIndex][sampleIndex] *= 1.0f;
53 for (
int sampleIndex = 0; sampleIndex < numSamples; sampleIndex++)
57 auto amp =
m_adsr.getNextSample();
60 modulatorBufferPtr[sampleIndex] = amp *
m_amount;
63 for (
int channelIndex = 0; channelIndex < numChannels; channelIndex++)
64 bufferPtr[channelIndex][sampleIndex] *= amp *
m_amount;
void setValues(const float *values, int numValues)
Definition ModulationSource.h:34
Definition AirAbsorptionFilter.cpp:2
static const int MIDI_NOTE_FLAG_DRONE_NOTEUP
Definition OscillatorUtils.h:23
static const int MIDI_NOTE_FLAG_DRONE
Definition OscillatorUtils.h:22