Processes a single sample from all registered nodes.
- Returns
- Combined output sample from all nodes
This method processes each registered node and combines their outputs into a single sample. It is typically called in a loop to process multiple samples, but can also be used for single-sample processing.
Definition at line 109 of file RootNode.cpp.
110{
112 return 0.;
113
114 auto sample = 0.;
115
117 if (!node)
118 continue;
119
120 uint32_t state = node->m_state.load();
121 double node_output = 0.0;
122
124 if (node->should_mock_process()) {
125 node->process_sample();
126 } else {
127 node_output = node->process_sample();
128 }
130 } else {
131 node_output = node->get_last_output();
132 }
133
134 if (node->needs_channel_routing()) {
135 node_output *= node->get_routing_state().amount[
m_channel];
136 }
137
138 sample += node_output;
139 }
140
142
143 return sample;
144}
std::vector< std::shared_ptr< Node > > m_Nodes
Collection of nodes registered with this root node.
uint32_t m_channel
The processing channel index for this root node.
bool preprocess()
Checks if the root node can process pending operations.
void postprocess()
Performs post-processing after all nodes have been processed.
@ 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.
References MayaFlux::Nodes::atomic_add_flag(), m_channel, m_Nodes, postprocess(), preprocess(), and MayaFlux::Nodes::PROCESSED.
Referenced by process_batch().