MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Nodes::Network::ModalDampingOperator Class Referencefinal

Adjust each ModalNetwork mode's decay from its previous block's RMS. More...

#include <ModalDampingOperator.hpp>

Inheritance diagram for MayaFlux::Nodes::Network::ModalDampingOperator:
Collaboration diagram for MayaFlux::Nodes::Network::ModalDampingOperator:

Classes

struct  ModeState
struct  Response

Public Types

using Controls = ModalDampingControls

Public Member Functions

std::string_view get_type_name () const override
 Type name for introspection.
 ModalDampingOperator (const std::shared_ptr< ModalNetwork > &network)
void process (float frames) override
 Process for one batch cycle.
std::optional< double > query_state (std::string_view name) const override
 The control of that name as the operator holds it, or "mode_count".
void read_controls (ModalDampingControls &controls) const
 Fills the controls whose value the operator holds outside the struct.
void set_mode (size_t index, const ModalDampingControls &controls)
 Change one mode's response from the numbers controls holds.
void set_parameter (std::string_view name, double value) override
 Sets the control of that name, so "loud_seconds" is the same as set({ .loud_seconds = ... }).
Public Member Functions inherited from MayaFlux::Nodes::Network::NetworkOperator
virtual void apply_mapped_one_to_one (ParameterKey key, const std::shared_ptr< NodeNetwork > &source)
 Apply a cached per-element key, delegating to apply_one_to_one by default.
virtual void apply_one_to_one (std::string_view param, const std::shared_ptr< NodeNetwork > &source)
 Apply ONE_TO_ONE parameter mapping (per-point control).
virtual bool demands_full_vertex_restore () const
 Whether a downstream compute pass writes the network's vertex buffer in place each cycle, so the geometry producer must keep restoring the CPU-authoritative vertex data every frame.
template<typename Self>
Self::Controls get (this const Self &self)
 The controls with the values the operator holds now.
template<typename Self>
void set (this Self &self, const typename Self::Controls &incoming)
 Apply the members of this operator's Controls struct that hold a value.
virtual void set_mapped_parameter (ParameterKey key, double value)
 Apply a cached mapping key, delegating to set_parameter by default.
virtual ~NetworkOperator ()=default

Private Member Functions

void apply_controls ()
bool apply_field (double Response::*member, double value)

Static Private Member Functions

static bool valid (const Response &response) noexcept

Private Attributes

ModalDampingControls & m_controls
Response m_default_response
std::vector< ModeState > m_modes
std::weak_ptr< ModalNetwork > m_network

Additional Inherited Members

Protected Member Functions inherited from MayaFlux::Nodes::Network::NetworkOperator
template<typename C>
C & declare_controls ()
 Create the operator's controls struct and keep it alive.
template<typename C>
void merge_controls (const C &incoming)
 Apply the members of incoming that hold a value, for an operator whose controls type is not fixed.
void refresh_controls ()
 Read node sources into their controls.
bool set_named_control (std::string_view name, double value)
 Sets the control called name, the way set() would.
bool settle_named_control (std::string_view name)
 Drops the pending typed value of the control called name.
template<typename C>
C snapshot_controls () const
 A copy of the declared struct, for an operator whose controls type is not fixed.

Detailed Description

Adjust each ModalNetwork mode's decay from its previous block's RMS.

Processing runs before the next block is rendered. A mode at zero RMS uses quiet_seconds; one at or above reference_rms uses loud_seconds. Intermediate levels interpolate between them. The response is smoothed in block time. The network keeps the last applied decay when this operator is removed.

auto damping = gong->add<ModalDampingOperator>();
damping->set({ .quiet_seconds = 3.5, .loud_seconds = 0.18 });
damping->set_mode(0, { .quiet_seconds = 7.0, .loud_seconds = 2.5 });
ModalDampingOperator(const std::shared_ptr< ModalNetwork > &network)

Definition at line 42 of file ModalDampingOperator.hpp.


The documentation for this class was generated from the following files: