Processes a single data sample.
- Parameters
-
| input | The input sample value |
- Returns
- The processed output sample value
This is the core processing method that all nodes must implement. It takes a single input value, applies the node's transformation algorithm, and returns the resulting output value.
For generator nodes that don't require input (like oscillators or stochastic generators), the input parameter may be ignored. Note: This method does NOT mark the node as processed. That responsibility belongs to the caller, typically a chained parent node or the root node.
Implements MayaFlux::Nodes::Node.
Definition at line 59 of file Counter.cpp.
60{
64
65 double trigger_val = 0.0;
68 } else {
71 }
72
75 }
77 }
78
81 auto prev =
static_cast<int32_t
>(
m_count);
82 int32_t next = (prev +
m_step);
83 int32_t wrapped = ((next %
static_cast<int32_t
>(
m_modulo)) +
static_cast<int32_t
>(
m_modulo)) %
static_cast<int32_t
>(
m_modulo);
84 m_wrapped = (wrapped < prev && m_step > 0) || (wrapped > prev &&
m_step < 0);
85 m_count =
static_cast<uint32_t
>(wrapped);
86 } else {
88 }
89
93
96
100 }
101
105 }
106
107 return output;
108}
double m_last_trigger_value
void notify_tick(double value) override
Notifies all registered callbacks with the current context.
std::shared_ptr< Node > m_reset_trigger
double m_amplitude
Base amplitude of the generator.
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...
@ PROCESSED
Node has been processed this cycle.
void atomic_add_flag(std::atomic< NodeState > &state, NodeState flag)
Atomically adds a flag to a node state.
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.
References MayaFlux::Nodes::atomic_add_flag(), MayaFlux::Nodes::atomic_dec_modulator_count(), MayaFlux::Nodes::atomic_inc_modulator_count(), MayaFlux::Nodes::Generator::Generator::m_amplitude, m_count, MayaFlux::Nodes::Node::m_fire_events_during_snapshot, MayaFlux::Nodes::Node::m_last_output, m_last_trigger_value, m_modulo, MayaFlux::Nodes::Node::m_networked_node, m_reset_trigger, MayaFlux::Nodes::Node::m_state_saved, m_step, m_wrapped, notify_tick(), MayaFlux::Nodes::PROCESSED, and MayaFlux::Nodes::try_reset_processed_state().
Referenced by process_batch().