Processes a single sample.
Computes the next output value based on the polynomial function and current mode.
55{
56 double result = 0.0;
57
63 } else {
66 }
67 }
68
72 break;
73
76 std::span<double> view;
77
80 } else {
83 }
84
86
88 }
89 break;
90
93 std::span<double> view;
94
97 } else {
100 }
101
103 }
104 break;
105 }
106
108
110
114 }
115
119 }
120
121 return result;
122}
Core::GlobalInputConfig input
std::span< T > linearized_view()
Get mutable linearized view of entire history.
void overwrite_newest(const T &value)
Overwrite the newest element without advancing position.
void push(const T &value)
Push new value to front of history.
void notify_tick(double value) override
Notifies all registered callbacks with the current context.
PolynomialMode m_mode
Current processing mode.
static double power_sum(const std::vector< double > &coefficients, double x) noexcept
Evaluates the coefficient list at x, highest power first.
Memory::HistoryBuffer< double > m_history
Ring buffer for input/output history.
double m_scale_factor
Scaling factor for output.
std::span< double > m_external_buffer_context
View into external buffer.
std::span< double > external_context_view(double input)
size_t m_buffer_size
Maximum size of the buffers.
BufferFunction m_buffer_function
Function for recursive/feedforward mode.
bool m_coef_direct
True while DIRECT output is evaluated from m_coefficients.
std::shared_ptr< Node > m_input_node
Input node for processing.
DirectFunction m_direct_function
Function for direct mode.
bool m_use_external_context
std::vector< double > m_coefficients
Polynomial coefficients (if using coefficient-based definition)
bool m_state_saved
tracks if the node's state has been saved by a snapshot operation
bool m_networked_node
Flag indicating if the node is part of a NodeNetwork This flag is used to disable event firing when t...
double m_last_output
The most recent sample value generated by this oscillator.
bool m_fire_events_during_snapshot
Internal flag controlling whether notify_tick fires during state snapshots Default: false (events don...
@ RECURSIVE
Evaluates using current and previous outputs: y[n] = f(y[n-1], y[n-2], ...)
@ DIRECT
Evaluates f(x) where x is the current phase/input.
@ FEEDFORWARD
Evaluates using current and previous inputs: y[n] = f(x[n], x[n-1], ...)
@ PROCESSED
Node has been processed this cycle.
void try_reset_processed_state(std::shared_ptr< Node > node)
Attempts to reset the processed state of a node.
void atomic_inc_modulator_count(std::atomic< uint32_t > &count, int amount)
Atomically increments the modulator count by a specified amount.
void atomic_dec_modulator_count(std::atomic< uint32_t > &count, int amount)
Atomically decrements the modulator count by a specified amount.
void atomic_add_flag(std::atomic< NodeState > &state, NodeState flag)
Atomically adds a flag to a node state.