41 double range_start,
double range_end,
double normal_spread)
43 , distribution_type(type)
44 , amplitude(amplitude)
45 , range_start(range_start)
46 , range_end(range_end)
47 , normal_spread(normal_spread)
93 std::span<const float> gpu_data)
94 :
StochasticContext(value, type, amplitude, range_start, range_end, normal_spread)
166 double process_sample(
double input = 0.)
override;
177 double random_sample(
double start,
double end);
187 std::vector<double> process_batch(
unsigned int num_samples)
override;
199 std::vector<double> random_array(
double start,
double end,
unsigned int num_samples);
207 void printGraph()
override;
215 void printCurrent()
override;
228 m_normal_spread = spread;
244 std::unique_ptr<NodeContext> create_context(
double value)
override;
254 void notify_tick(
double value)
override;
264 double generate_distributed_sample();
276 [[nodiscard]]
double transform_sample(
double sample,
double start,
double end)
const;
287 void validate_range(
double start,
double end)
const;
Base class for all signal and pattern generators in Maya Flux.
Utils::distribution m_type
Current probability distribution algorithm.
void set_type(Utils::distribution type)
Changes the probability distribution type.
~Random() override=default
Virtual destructor.
double m_normal_spread
Variance parameter for normal distribution.
void save_state() override
Saves the node's current state for later restoration Recursively cascades through all connected modul...
void set_normal_spread(double spread)
Sets the variance parameter for normal distribution.
std::mt19937 m_random_engine
Mersenne Twister entropy generator.
double m_current_start
Lower bound of the current output range.
void restore_state() override
Restores the node's state from the last save Recursively cascades through all connected modulator nod...
double m_current_end
Upper bound of the current output range.
Computational stochastic signal generator with multiple probability distributions.
StochasticContextGpu(double value, Utils::distribution type, double amplitude, double range_start, double range_end, double normal_spread, std::span< const float > gpu_data)
Utils::distribution distribution_type
Current distribution type.
StochasticContext(double value, Utils::distribution type, double amplitude, double range_start, double range_end, double normal_spread)
Constructs a StochasticContext with the current generator state.
double normal_spread
Current variance parameter for normal distribution.
double amplitude
Current amplitude scaling factor.
double range_start
Current lower bound of the range.
double range_end
Current upper bound of the range.
Specialized context for stochastic generator callbacks.
GPU-uploadable 1D array data interface.
Base context class for node callbacks.