MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_neighbourhood()

void MayaFlux::Buffers::LogicProcessor::set_neighbourhood ( size_t  radius,
size_t  generations = 1,
bool  wrap = true,
bool  memory = false 
)

Treats the samples of a block as cells of an automaton.

Parameters
radiusCells on each side that feed a cell
generationsSteps per block; 0 turns it off
wrapWhether the block's ends meet, otherwise cells beyond them are 0
memoryWhether the block perturbs the previous result instead of replacing it

Needs a parallel node. A cell is 1 when its sample is above zero, and the node is evaluated for every cell with 2 * radius + 1 slots, slot 0 the cell furthest to the right and the last slot the furthest to the left, so Wolfram's rule numbers work with input_truth_table_state(3, rule). With memory the block's cells are XORed into the previous block's final generation, so the pattern evolves across blocks; use one processor per channel (clone) for that. The logic data is the final generation, 0 or 1.

Definition at line 221 of file LogicProcessor.cpp.

222{
224 m_generations = generations;
225 m_wrap = wrap;
226 m_memory = memory;
227 m_previous_cells.clear();
228}
float radius
size_t m_generations
Automaton steps per block, 0 when off.
bool m_wrap
Whether the automaton's block ends meet.
std::vector< uint8_t > m_previous_cells
Last automaton result, kept when memory is on.
size_t m_radius
Neighbourhood radius of the automaton.
bool m_memory
Whether blocks perturb the previous automaton result.
T wrap(T x, T lo, T hi) noexcept
Wrap x into [lo, hi) with modulo semantics.
Definition Scalar.hpp:218

References m_generations, m_memory, m_previous_cells, m_radius, m_wrap, and radius.