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

◆ ExponentialRamp()

std::vector< double > MayaFlux::Nodes::Generator::ExponentialRamp ( size_t  length,
double  start = 0.001,
double  end = 1.0 
)

Creates an exponential ramp function.

Parameters
lengthNumber of samples in the ramp
startStarting value (default: 0.001)
endEnding value (default: 1.0)
Returns
Vector containing the ramp function values

An exponential ramp changes at a rate proportional to its current value, creating a curve that follows natural growth or decay patterns. Useful for:

  • Perceptually balanced transitions
  • Parameter sweeps with natural-sounding transitions
  • Creating more organic envelope shapes

Note: The start value defaults to 0.001 instead of 0.0 because a true exponential curve cannot start at zero.

Definition at line 54 of file WindowGenerator.cpp.

55{
56 std::vector<double> ramp(length);
57 if (length == 1)
58 return { start };
59 const double growth = std::pow(end / start, 1.0 / (length - 1));
60 ramp[0] = start;
61 for (size_t i = 1; i < length; ++i) {
62 ramp[i] = ramp[i - 1] * growth;
63 }
64 return ramp;
65}