126 void process (
const ProcessContext& context)
noexcept
129 auto&& outBlock = context.getOutputBlock();
130 auto&& inBlock = context.getInputBlock();
133 jassert (outBlock.getNumSamples() <=
static_cast<size_t> (rampBuffer.size()));
135 auto len = outBlock.getNumSamples();
136 auto numChannels = outBlock.getNumChannels();
137 auto inputChannels = inBlock.getNumChannels();
140 if (context.isBypassed)
141 context.getOutputBlock().clear();
143 if (frequency.isSmoothing())
145 auto* buffer = rampBuffer.getRawDataPointer();
147 for (
size_t i = 0; i < len; ++i)
148 buffer[i] = phase.advance (baseIncrement * frequency.getNextValue())
151 if (! context.isBypassed)
155 if (context.usesSeparateInputAndOutputBlocks())
157 for (ch = 0; ch < jmin (numChannels, inputChannels); ++ch)
159 auto* dst = outBlock.getChannelPointer (ch);
160 auto* src = inBlock.getChannelPointer (ch);
162 for (
size_t i = 0; i < len; ++i)
163 dst[i] = src[i] + generator (buffer[i]);
168 for (ch = 0; ch < jmin (numChannels, inputChannels); ++ch)
170 auto* dst = outBlock.getChannelPointer (ch);
172 for (
size_t i = 0; i < len; ++i)
173 dst[i] += generator (buffer[i]);
177 for (; ch < numChannels; ++ch)
179 auto* dst = outBlock.getChannelPointer (ch);
181 for (
size_t i = 0; i < len; ++i)
182 dst[i] = generator (buffer[i]);
188 auto freq = baseIncrement * frequency.getNextValue();
191 if (context.isBypassed)
193 frequency.skip (
static_cast<int> (len));
200 if (context.usesSeparateInputAndOutputBlocks())
202 for (ch = 0; ch < jmin (numChannels, inputChannels); ++ch)
205 auto* dst = outBlock.getChannelPointer (ch);
206 auto* src = inBlock.getChannelPointer (ch);
208 for (
size_t i = 0; i < len; ++i)
214 for (ch = 0; ch < jmin (numChannels, inputChannels); ++ch)
217 auto* dst = outBlock.getChannelPointer (ch);
219 for (
size_t i = 0; i < len; ++i)
224 for (; ch < numChannels; ++ch)
227 auto* dst = outBlock.getChannelPointer (ch);
229 for (
size_t i = 0; i < len; ++i)