86 [[nodiscard]]
virtual std::pair<double, double>
couple(
double end_pressure,
double interior_flow) = 0;
93 [[nodiscard]] std::optional<double>
query_state(std::string_view )
const override {
return std::nullopt; }
106 [[nodiscard]] std::pair<double, double>
couple(
double end_pressure,
double interior_flow)
override;
107 [[nodiscard]] std::string_view
get_type_name()
const override {
return "Wall"; }
190 explicit ReedOperator(
double width = 0.012,
double rest_opening = 4.0e-4,
double closing_pressure = 3000.0);
198 [[nodiscard]] std::pair<double, double>
couple(
double end_pressure,
double interior_flow)
override;
199 void reset()
override;
201 void process(
float frames)
override;
202 void set_parameter(std::string_view param,
double value)
override;
203 [[nodiscard]] std::optional<double>
query_state(std::string_view query)
const override;
204 [[nodiscard]] std::string_view
get_type_name()
const override {
return "Reed"; }
262 [[nodiscard]] std::pair<double, double>
couple(
double end_pressure,
double interior_flow)
override;
263 void reset()
override;
265 [[nodiscard]] std::string_view
get_type_name()
const override {
return "Radiation"; }
268 [[nodiscard]] std::optional<Kinesis::Acoustics::RadiationCoefficients> coefficients_for(
310 [[nodiscard]] std::pair<double, double>
couple(
double end_pressure,
double interior_flow)
override;
311 void reset()
override;
313 void process(
float frames)
override;
314 void set_parameter(std::string_view param,
double value)
override;
315 [[nodiscard]] std::optional<double>
query_state(std::string_view query)
const override;
316 [[nodiscard]] std::string_view
get_type_name()
const override {
return "Junction"; }
#define MF_DESCRIBE(...)
Requests a generated member description for a struct at namespace scope.
Interleaved grid of a one dimensional acoustic bore.
Same-sample coupling of an end cell to a flow that depends on the pressure across it.
Open end of a bore as a passive second order radiation load.
Quasi-static single reed and its same-sample coupling to the bore.
Interior propagation of a bore on its interleaved grid, with the discrete energy and a pickup.
One named control of a network or operator: empty, a value, or a mapped source.
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.
std::function< Kinesis::Acoustics::FlowSample(double)> FlowLaw
std::atomic< uint8_t > m_status
void reset() override
Clear the state, keeping the parameters.
void set_parameter(std::string_view param, double value) override
Set operator parameter.
std::string_view get_type_name() const override
Type name for introspection.
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.
std::atomic< double > m_maximum_flow
std::pair< double, double > couple(double end_pressure, double interior_flow) override
Advance the end cell and its coupling by one sample.
JunctionControls Controls
std::optional< double > query_state(std::string_view query) const override
Query operator internal state.
JunctionOperator(FlowLaw law, double maximum_flow, double driving_pressure=0.0)
void process(float frames) override
Process for one batch cycle.
JunctionControls & m_controls
std::atomic< double > m_driving_pressure
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.
Domain-agnostic interpretive lens for network processing.
Kinesis::Acoustics::RadiationCoefficients m_coefficients
Kinesis::Acoustics::RadiationModel m_model
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.
std::pair< double, double > couple(double end_pressure, double interior_flow) override
Advance the end cell and its coupling by one sample.
Kinesis::Acoustics::RadiationState m_state
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 reset() override
Clear the state, keeping the parameters.
std::string_view get_type_name() const override
Type name for introspection.
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.
RadiationOperator(Kinesis::Acoustics::RadiationModel model=Kinesis::Acoustics::unflanged_radiation)
std::atomic< double > m_resonance
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.
std::atomic< double > m_rest_opening
std::string_view get_type_name() const override
Type name for introspection.
std::optional< double > query_state(std::string_view query) const override
Query operator internal state.
void set_parameter(std::string_view param, double value) override
Set operator parameter.
std::atomic< double > m_noise
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.
ReedOperator(double width=0.012, double rest_opening=4.0e-4, double closing_pressure=3000.0)
void reset() override
Clear the state, keeping the parameters.
std::atomic< double > m_reed_damping
double next_white() noexcept
std::array< double, 2 > m_motion
std::atomic< double > m_smoothing
void process(float frames) override
Process for one batch cycle.
std::atomic< double > m_width
std::atomic< double > m_lip
std::atomic< double > m_target_pressure
std::atomic< double > m_noise_cutoff
std::pair< double, double > couple(double end_pressure, double interior_flow) override
Advance the end cell and its coupling by one sample.
ReedControls & m_controls
std::atomic< bool > m_unique
std::atomic< double > m_closing_pressure
std::atomic< double > m_reed_area
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.
Kinesis::Acoustics::ReedChannel channel() const noexcept
virtual void reset()
Clear the state, keeping the parameters.
virtual std::pair< double, double > couple(double end_pressure, double interior_flow)=0
Advance the end cell and its coupling by one sample.
void process(float) override
Process for one batch cycle.
std::optional< double > query_state(std::string_view) const override
Query operator internal state.
virtual void prepare(const Kinesis::Acoustics::DuctGrid &grid, const Kinesis::Acoustics::DuctSpec &spec, DuctEnd end)=0
Bind to a grid and end, and reset the state.
virtual bool accepts(const Kinesis::Acoustics::DuctGrid &grid, const Kinesis::Acoustics::DuctSpec &spec, DuctEnd end) const =0
Whether prepare would succeed for this grid and end.
virtual void retarget(const Kinesis::Acoustics::DuctGrid &grid, const Kinesis::Acoustics::DuctSpec &spec, DuctEnd end)
Bind to a new grid of the same duct while it keeps sounding.
void set_parameter(std::string_view, double) override
Set operator parameter.
What closes one end of a DuctNetwork: a wall, a reed, a radiating opening, or any pressure dependent ...
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.
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.
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.
A rigid closed end: no flow through the face.
std::array< double, 3 > RadiationModel
The three dimensionless constants of the radiation network, as gamma, lambda and theta.
constexpr RadiationModel unflanged_radiation
Unflanged circular pipe, end correction 0.6133 a.
std::pair< double, double > FlowSample
Flow through a coupling, then its slope against the pressure difference.
DuctEnd
Which end of a duct an operator terminates.
Prepared grid and update gains of one bore.
Physical and sampling constants a grid is built from.
Prepared coefficients of one end, built once per bore or step change.
Inductor flow and branch pressure, zero at rest.
Geometry and constants of the reed channel.
Controls of a JunctionOperator, each a number or a mapped node.
Controls of a ReedOperator, each a number or a mapped node.