Processes num_samples through all resonators and accumulates output.
For each sample, each resonator draws from its individual exciter (or the network-level exciter, or zero if none) and processes one sample. All resonator outputs are summed and normalised into m_last_audio_buffer.
206{
209 std::this_thread::yield();
210
213 return;
214 }
215
217
218 thread_local std::vector<double> scratch;
219 scratch.assign(num_samples, 0.0);
220
221 const double norm = 1.0 /
static_cast<double>(
m_resonators.size());
222
225 nb.reserve(num_samples);
226
227 std::vector<std::optional<std::span<const double>>> net_exc_bufs;
232 }
233
234 for (size_t s = 0; s < num_samples; ++s) {
237 double excitation = 0.0;
238
239 if (r.exciter) {
240 excitation = r.exciter->process_sample(0.0);
241 } else if (!net_exc_bufs.empty() && net_exc_bufs[ri] && s < net_exc_bufs[ri]->size()) {
242 excitation = (*net_exc_bufs[ri])[s];
244 excitation =
m_exciter->process_sample(0.0);
245 }
246
247 const double out = r.filter->process_sample(excitation) * r.gain;
248 r.last_output = out;
250 scratch[s] += out * norm;
251 }
252 }
253
255 std::this_thread::yield();
256
260}
void apply_output_scale()
Apply m_output_scale to m_last_audio_buffer.
std::atomic_flag m_audio_buffer_lock
Spinlock guarding m_last_audio_buffer.
std::vector< double > m_last_audio_buffer
Mixed output from last process_batch()
std::vector< std::vector< double > > m_node_buffers
Per-resonator sample buffers populated each process_batch()
std::vector< ResonatorNode > m_resonators
std::shared_ptr< Node > m_exciter
networ-level shared exciter (may be nullptr)
void update_mapped_parameters()
Apply all registered parameter mappings for the current cycle.
std::shared_ptr< NodeNetwork > m_network_exciter
Optional NodeNetwork exciter for ONE_TO_ONE mapping (may be nullptr)