MayaFlux 0.4.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 350 of file ResonatorNetwork.cpp.

352{
353 const size_t count = std::min(m_resonators.size(), source->get_node_count());
354
355 for (size_t i = 0; i < count; ++i) {
356 const auto val = source->get_node_output(i);
357 if (!val.has_value()) {
358 continue;
359 }
360 if (param == "frequency") {
361 set_frequency(i, *val);
362 } else if (param == "q") {
363 set_q(i, *val);
364 } else if (param == "gain") {
365 m_resonators[i].gain = *val;
366 }
367 }
368}
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: