MayaFlux 0.2.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 337 of file ResonatorNetwork.cpp.

339{
340 const size_t count = std::min(m_resonators.size(), source->get_node_count());
341
342 for (size_t i = 0; i < count; ++i) {
343 const auto val = source->get_node_output(i);
344 if (!val.has_value()) {
345 continue;
346 }
347 if (param == "frequency") {
348 set_frequency(i, *val);
349 } else if (param == "q") {
350 set_q(i, *val);
351 } else if (param == "gain") {
352 m_resonators[i].gain = *val;
353 }
354 }
355}
Eigen::Index 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.

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: