MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ apply_one_to_one_parameter()

void MayaFlux::Nodes::Network::ResonatorNetwork::apply_one_to_one_parameter ( const std::string &  param,
const std::shared_ptr< NodeNetwork > &  source 
)
private

Apply ONE_TO_ONE values from a source network to the named parameter.

Parameters
param"frequency", "q", or "gain"
sourceNodeNetwork providing one value per resonator

Definition at line 352 of file ResonatorNetwork.cpp.

354{
355 const size_t count = std::min(m_resonators.size(), source->get_node_count());
356
357 for (size_t i = 0; i < count; ++i) {
358 const auto val = source->get_node_output(i);
359 if (!val.has_value()) {
360 continue;
361 }
362 if (param == "frequency") {
363 set_frequency(i, *val);
364 } else if (param == "q") {
365 set_q(i, *val);
366 } else if (param == "gain") {
367 m_resonators[i].gain = *val;
368 }
369 }
370}
size_t count
void set_frequency(size_t index, double frequency)
Set centre frequency of a single resonator and recompute its coefficients.
void set_q(size_t index, double q)
Set Q factor of a single resonator and recompute its coefficients.
Source source()
Begin a Source chain.
Definition Plot.hpp:128

References count, m_resonators, set_frequency(), and set_q().

Referenced by update_mapped_parameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: