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

◆ retune() [1/2]

void MayaFlux::Nodes::Network::ResonatorNetwork::retune ( size_t  index,
double  frequency 
)

Move a resonator's centre frequency without clearing its state.

Parameters
indexResonator index (0-based)
frequencyNew centre frequency in Hz, clamped below Nyquist
Exceptions
std::out_of_rangeif index >= get_node_count()

The stored damping number is kept, so the ring time scales with the new frequency. Follow with set_decay to hold it. Written in place and not atomic with respect to a sample in flight.

Definition at line 434 of file ResonatorNetwork.cpp.

435{
436 if (index >= m_resonators.size()) {
437 error<std::out_of_range>(Journal::Component::Nodes, Journal::Context::NodeProcessing, std::source_location::current(),
438 "ResonatorNetwork::retune: index out of range (index={}, resonator_count={})", index, m_resonators.size());
439 }
440 auto& r = m_resonators[index];
441 r.frequency = std::clamp(frequency, 1.0, m_sample_rate * 0.5 - 1.0);
443}
double frequency
uint32_t index
Definition VKDevice.cpp:122
void write_biquad_in_place(ResonatorNode &r)
Write the same biquad as compute_biquad through the filter's edit spans.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References frequency, index, m_resonators, MayaFlux::Nodes::Network::NodeNetwork::m_sample_rate, MayaFlux::Journal::NodeProcessing, MayaFlux::Journal::Nodes, and write_biquad_in_place().

Referenced by apply_broadcast_parameter(), apply_one_to_one_parameter(), and retune().

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