|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Any flow that depends on the pressure difference across it. More...
#include <TerminationOperators.hpp>
Public Types | |
| using | Controls = JunctionControls |
| using | FlowLaw = std::function<Kinesis::Acoustics::FlowSample(double)> |
Public Member Functions | |
| bool | accepts (const Kinesis::Acoustics::DuctGrid &grid, const Kinesis::Acoustics::DuctSpec &spec, DuctEnd end) const override |
| Whether prepare would succeed for this grid and end. | |
| std::pair< double, double > | couple (double end_pressure, double interior_flow) override |
| Advance the end cell and its coupling by one sample. | |
| std::string_view | get_type_name () const override |
| Type name for introspection. | |
| JunctionOperator (FlowLaw law, double maximum_flow, double driving_pressure=0.0) | |
| void | prepare (const Kinesis::Acoustics::DuctGrid &grid, const Kinesis::Acoustics::DuctSpec &spec, DuctEnd end) override |
| Bind to a grid and end, and reset the state. | |
| void | process (float frames) override |
| Process for one batch cycle. | |
| std::optional< double > | query_state (std::string_view query) const override |
| Query operator internal state. | |
| void | read_controls (JunctionControls &controls) const |
| Fills every control with the value the junction holds now. | |
| void | reset () override |
| Clear the state, keeping the parameters. | |
| void | retarget (const Kinesis::Acoustics::DuctGrid &grid, const Kinesis::Acoustics::DuctSpec &spec, DuctEnd end) override |
| Bind to a new grid of the same duct while it keeps sounding. | |
| void | set_parameter (std::string_view param, double value) override |
| Set operator parameter. | |
| Public Member Functions inherited from MayaFlux::Nodes::Network::TerminationOperator | |
| void | process (float) override |
| Process for one batch cycle. | |
| std::optional< double > | query_state (std::string_view) const override |
| Query operator internal state. | |
| void | set_parameter (std::string_view, double) override |
| Set operator parameter. | |
| 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 () |
Private Attributes | |
| JunctionControls & | m_controls |
| std::atomic< double > | m_driving_pressure |
| double | m_end_gain {} |
| double | m_guess {} |
| FlowLaw | m_law |
| std::atomic< double > | m_maximum_flow |
| std::atomic< uint8_t > | m_status { 0 } |
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. | |
Any flow that depends on the pressure difference across it.
The flow law maps a pressure difference, driving pressure minus end pressure, to a FlowSample of flow and slope. It runs on the audio thread and must not throw. The law must make d + gain * flow(d) increasing, and its flow must stay within maximum_flow, which sets the bracket of the solve. Parameters: "driving_pressure" and "maximum_flow". query_state "status" answers the last solve's RootStatus as a number.
Definition at line 291 of file TerminationOperators.hpp.