pub type GeneratorFunction = fn(Float) -> Sample;Expand description
Generator function.
A generator function is the core of a signal generator, the SignalGenerator type uses these
function to create periodic waveforms.
§Arguments
- A
Floatrepresenting a time in the signal to generate. The scale of this variable is normalized to the period of the signal, such that “0.0” is time zero, “1.0” is one period of the signal, “2.0” is two periods and so on. This function should be written to accept any float in the range (Float::MIN,Float::MAX) butSignalGeneratorwill only pass values in (0.0, 1.0) to mitigate floating point error.
§Returns
A Sample (Float) representing the signal level at the passed time. This value should be normalized
in the range [-1.0,1.0].