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

◆ set_decay() [1/2]

void MayaFlux::Nodes::Network::ResonatorNetwork::set_decay ( size_t  index,
double  seconds 
)

Set how long a resonator rings, without clearing its state.

Parameters
indexResonator index (0-based)
secondsTime for the ring envelope to fall by 1/e, no upper limit
Exceptions
std::out_of_rangeif index >= get_node_count()

Sets the pole radius directly and derives the stored q from it, so q follows rather than leads and is not limited to the range set_q accepts. Written in place and not atomic with respect to a sample in flight.

Definition at line 445 of file ResonatorNetwork.cpp.

446{
447 if (index >= m_resonators.size()) {
448 error<std::out_of_range>(Journal::Component::Nodes, Journal::Context::NodeProcessing, std::source_location::current(),
449 "ResonatorNetwork::set_decay: index out of range (index={}, resonator_count={})", index, m_resonators.size());
450 }
451 auto& r = m_resonators[index];
452
453 r.q = Kinesis::Discrete::q_from_decay(r.frequency, seconds, m_sample_rate);
455}
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.
double q_from_decay(double frequency, double seconds, double sample_rate) noexcept
Q that gives the bandpass section a stated ring time.

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

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

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