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

◆ set_mode()

void MayaFlux::Nodes::Network::ModalDampingOperator::set_mode ( size_t index,
const ModalDampingControls & controls )

Change one mode's response from the numbers controls holds.

A pending set() is applied first, so calls take effect in the order made. An index past the last mode, or a value that would make the response invalid, is ignored with a warning. Like the other mode edits this belongs outside the block.

Definition at line 40 of file ModalDampingOperator.cpp.

41{
44
45 if (index >= m_modes.size()) {
47 "ModalDampingOperator ignored mode {}, it has {} modes", index, m_modes.size());
48 return;
49 }
50
51 auto& mode = m_modes[index];
52 const auto field = [&](const Control& control, double Response::* member, std::string_view name) {
53 if (!control.has_value() || control.sourced()) {
54 return;
55 }
56
57 Response candidate = mode.response;
58 candidate.*member = control.value();
59 if (!valid(candidate)) {
61 "ModalDampingOperator ignored invalid value for {}", name);
62 return;
63 }
64 mode.response = candidate;
65 };
66
67 field(controls.quiet_seconds, &Response::quiet_seconds, "quiet_seconds");
68 field(controls.loud_seconds, &Response::loud_seconds, "loud_seconds");
69 field(controls.reference_rms, &Response::reference_rms, "reference_rms");
70 field(controls.smoothing_seconds, &Response::smoothing_seconds, "smoothing_seconds");
71}
#define MF_WARN(comp, ctx,...)
static bool valid(const Response &response) noexcept
void refresh_controls()
Read node sources into their controls.
@ Configuration
Configuration and parameter updates.
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
std::vector< double > mode(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Mode per window via tolerance-bucketed frequency count.
Definition Analysis.cpp:580

References apply_controls(), MayaFlux::Journal::Configuration, MayaFlux::ControlValue::has_value(), MayaFlux::Nodes::Network::ModalDampingControls::loud_seconds, MayaFlux::Nodes::Network::ModalDampingOperator::Response::loud_seconds, m_modes, MF_WARN, MayaFlux::Journal::Nodes, MayaFlux::Nodes::Network::ModalDampingControls::quiet_seconds, MayaFlux::Nodes::Network::ModalDampingOperator::Response::quiet_seconds, MayaFlux::Nodes::Network::ModalDampingControls::reference_rms, MayaFlux::Nodes::Network::ModalDampingOperator::Response::reference_rms, MayaFlux::Nodes::Network::NetworkOperator::refresh_controls(), MayaFlux::Nodes::Network::ModalDampingControls::smoothing_seconds, MayaFlux::Nodes::Network::ModalDampingOperator::Response::smoothing_seconds, MayaFlux::Nodes::Network::Control::sourced(), valid(), and MayaFlux::ControlValue::value().

Here is the call graph for this function: