Processes a single input sample through the logic function.
Evaluates the input according to the configured logic operation and computational model, producing a binary output (0.0 or 1.0).
196{
197 bool result = false;
199
205 } else {
208 }
209 }
210
212 if (pulled) {
214 }
215
218
223 result = current_bool;
224 break;
225
231 }
233 break;
234
237 if (current_bool != previous_bool_input) {
241 break;
244 break;
247 break;
248 }
249 }
251 break;
252 }
253
255 result = current_bool && previous_bool;
256 break;
257
259 result = current_bool || previous_bool;
260 break;
261
263 result = current_bool != previous_bool;
264 break;
265
267 result = !current_bool;
268 break;
269
271 result = !(current_bool && previous_bool);
272 break;
273
275 result = !(current_bool || previous_bool);
276 break;
277
280 break;
281
282 default:
283 result = current_bool;
284 }
285 break;
286
292 break;
293 }
294
298 break;
299 }
300
302 if (!pulled) {
306 }
308 break;
309 }
310 }
311
313 auto current = result ? 1.0 : 0.0;
314
318 }
319
320 if (pulled) {
322 }
323
327 }
328
331}
Core::GlobalInputConfig input
SequentialFunction m_sequential_function
Function for sequential mode.
TemporalFunction m_temporal_function
Function for temporal mode.
DirectFunction m_direct_function
Function for direct mode.
std::vector< std::shared_ptr< Node > > m_input_nodes
Nodes feeding the input slots in parallel input mode.
EdgeType m_edge_type
Type of edge to detect.
double m_threshold
Threshold for boolean conversion.
double m_temporal_time
Time tracking for temporal mode.
double m_high_threshold
High threshold for hysteresis.
double m_input
Current input value for multi-input mode.
std::vector< double > m_input_buffer
std::shared_ptr< Node > m_input_node
Input node for processing.
LogicOperator m_operator
Current logic operator.
void history_push(bool val)
double m_low_threshold
Low threshold for hysteresis.
MultiInputFunction m_multi_input_function
Function for recursive/feedforward mode.
bool m_edge_detected
Whether an edge was detected in the last processing.
bool m_hysteresis_state
State for hysteresis operator.
LogicMode m_mode
Current processing mode.
void release_input_nodes()
std::span< bool > history_linearized_view()
void notify_tick(double value) override
Notifies all registered callbacks about a new sample.
size_t m_input_count
Expected number of inputs for multi-input mode.
void add_input(double input, size_t index)
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...
uint32_t m_sample_rate
Sample rate for audio processing, used for normalization.
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...
@ FALLING
High-to-low transition (1→0)
@ BOTH
Any state transition.
@ RISING
Low-to-high transition (0→1)
@ SEQUENTIAL
State-based evaluation using history of inputs (sequential logic)
@ DIRECT
Stateless evaluation of current input only (combinational logic)
@ TEMPORAL
Time-dependent evaluation with timing constraints.
@ MULTI_INPUT
Parallel evaluation of multiple input signals.
@ NOT
Logical NOT - inverts the input.
@ NOR
Logical NOR - inverted OR operation.
@ OR
Logical OR - true when any input is true.
@ NAND
Logical NAND - inverted AND operation.
@ THRESHOLD
Binary quantization - true when input exceeds threshold.
@ AND
Logical AND - true only when all inputs are true.
@ EDGE
Transition detector - identifies state changes.
@ HYSTERESIS
Threshold with memory - prevents rapid oscillation at boundary.
@ CUSTOM
User-defined boolean function.
@ XOR
Logical XOR - true when odd number of inputs are true.
@ 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.