|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API std::shared_ptr< Vruta::Routine > MayaFlux::Kriya::pattern | ( | std::function< std::any(uint64_t)> | pattern_func, |
| std::function< void(std::any)> | callback, | ||
| double | interval_seconds, | ||
| Vruta::ProcessingToken | token = Vruta::ProcessingToken::SAMPLE_ACCURATE |
||
| ) |
Creates a generative algorithm that produces values based on a pattern function.
| pattern_func | Function that generates values based on a step index |
| callback | Function to execute with each generated value |
| interval_seconds | Time between pattern steps in seconds |
The pattern task provides a powerful framework for algorithmic generation of values according to any computational pattern or rule system. At regular intervals, it calls the pattern_func with the current step index, then passes the returned value to the callback function.
This mechanism enables the creation of generative algorithms, procedural sequences, emergent behaviors, and rule-based systems that can influence any aspect of a computational environment - from audio parameters to visual elements, data transformations, or cross-domain mappings.
Example usage:
The pattern task continues indefinitely until explicitly cancelled, creating an ongoing generative process within the computational system.
Definition at line 116 of file Tasks.cpp.
References MayaFlux::Vruta::FRAME_ACCURATE, MayaFlux::Kriya::FrameDelay::frames_to_wait, MayaFlux::Vruta::seconds_to_frames(), and MayaFlux::Vruta::seconds_to_samples().
Referenced by MayaFlux::schedule_pattern().
Here is the call graph for this function:
Here is the caller graph for this function: