|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API Vruta::SoundRoutine MayaFlux::Kriya::pattern | ( | Vruta::TaskScheduler & | scheduler, |
| std::function< std::any(uint64_t)> | pattern_func, | ||
| std::function< void(std::any)> | callback, | ||
| double | interval_seconds | ||
| ) |
Creates a generative algorithm that produces values based on a pattern function.
| scheduler | The task scheduler that will manage this generator |
| 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 91 of file Tasks.cpp.
References MayaFlux::Vruta::TaskScheduler::seconds_to_samples().
Referenced by MayaFlux::create_pattern().
Here is the call graph for this function:
Here is the caller graph for this function: