|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
Main generator class for analog-style random modulation. More...
#include <AnalogRandom.h>
Public Member Functions | |
| Generator () noexcept | |
| Generator (std::uint64_t seed) noexcept | |
| Generator (Generator &&other) noexcept | |
| Generator & | operator= (Generator &&other) noexcept |
| Generator (const Generator &)=delete | |
| Generator & | operator= (const Generator &)=delete |
| void | prepare (double sampleRate) noexcept |
| Prepare the generator with the audio sample rate. | |
| void | reset () noexcept |
| Reset internal state (phase, smoothing, noise states). | |
| void | reseed (std::uint64_t newSeed) noexcept |
| Request a lock-free reseed of the internal PRNG. | |
| Real | getNextSample () noexcept |
| Generate and return the next modulation sample. | |
| void | getNextBlock (std::span< Real > outputBuffer) noexcept |
| Generate a block of modulation samples. | |
| Real | getCurrentValue () const noexcept |
| Last published output value. Lock-free readout, any thread (relaxed atomic; updated once per getNextSample() and once per getNextBlock() block). | |
| Real | getPhase () const noexcept |
| Last published LFO phase in [0, 1). Lock-free readout, any thread (relaxed atomic; same publication points as getCurrentValue()). Independent word: it may be one sample newer or older than getCurrentValue() (benign for displays). | |
| void | setNoiseType (NoiseType type) noexcept |
| void | setRateHz (Real rateInHz) noexcept |
| void | setRateBPM (double bpm, BpmDivision division) noexcept |
| void | updateBPM (double newBpm) noexcept |
| template<typename T > | |
| void | setRange (T min, T max) noexcept |
| Set the output range for values. Safe from tearing. | |
| void | setSmoothing (bool shouldBeEnabled, Real timeInMs=static_cast< Real >(50.0)) noexcept |
| Enables one-pole smoothing of the held targets. | |
| void | setQuantization (Real step) noexcept |
| void | setAnalogDefault (AnalogComponent component) noexcept |
| template<typename Int > | |
| Int | getNextDiscrete (Int imin, Int imax) noexcept |
| int | getNextDiscreteInt (int imin, int imax) noexcept |
Main generator class for analog-style random modulation.
| Real | Floating point type to represent values (float or double). |
Definition at line 172 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 178 of file AnalogRandom.h.
|
inlineexplicitnoexcept |
Definition at line 183 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 193 of file AnalogRandom.h.
|
delete |
|
inlinenoexcept |
Last published output value. Lock-free readout, any thread (relaxed atomic; updated once per getNextSample() and once per getNextBlock() block).
Definition at line 414 of file AnalogRandom.h.
|
inlinenoexcept |
Generate a block of modulation samples.
| outputBuffer | C++20 span representing the destination buffer. |
Definition at line 353 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 526 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 546 of file AnalogRandom.h.
|
inlinenoexcept |
Generate and return the next modulation sample.
Definition at line 305 of file AnalogRandom.h.
|
inlinenoexcept |
Last published LFO phase in [0, 1). Lock-free readout, any thread (relaxed atomic; same publication points as getCurrentValue()). Independent word: it may be one sample newer or older than getCurrentValue() (benign for displays).
Definition at line 423 of file AnalogRandom.h.
|
delete |
|
inlinenoexcept |
Definition at line 221 of file AnalogRandom.h.
|
inlinenoexcept |
Prepare the generator with the audio sample rate.
| sampleRate | Sample rate in Hz (must be > 0). |
Definition at line 261 of file AnalogRandom.h.
|
inlinenoexcept |
Request a lock-free reseed of the internal PRNG.
| newSeed | New seed value. Applied on the next audio tick. |
Definition at line 290 of file AnalogRandom.h.
|
inlinenoexcept |
Reset internal state (phase, smoothing, noise states).
Definition at line 274 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 488 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 432 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 482 of file AnalogRandom.h.
|
inlinenoexcept |
Set the output range for values. Safe from tearing.
Definition at line 459 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 443 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 437 of file AnalogRandom.h.
|
inlinenoexcept |
Enables one-pole smoothing of the held targets.
| shouldBeEnabled | True to smooth, false for hard steps. |
| timeInMs | Time constant in ms; zero, negative or NaN means instantaneous. Stored as a time, so it stays correct across a later prepare() at another rate. |
Definition at line 474 of file AnalogRandom.h.
|
inlinenoexcept |
Definition at line 450 of file AnalogRandom.h.