Two decorrelated OU walks presented as the two things drift is actually wired to: a pitch ratio and a unit fraction.
More...
|
| void | prepare (double sample_rate) |
| void | set_cents (double cents) |
| | Peak-ish pitch excursion in cents, scaled by the walk's unit output.
|
| void | set_theta (double theta_per_second) |
| void | set_sigma (double sigma) |
| void | seed (std::uint32_t s) |
| | The two walks are seeded from one user-facing seed through mix64 so they are decorrelated by construction; seeding them s and s + 1 would leave them visibly related for the first few draws.
|
| void | set_seed (std::uint32_t s) |
| void | set_depth_percent (double percent) |
| void | set_correlation_time (double seconds) |
| void | reset () |
| SampleType | next () |
| | Advance one audio sample. Call once per sample; read the outputs after.
|
| SampleType | pitch_factor () const |
| | Multiplicative pitch ratio: 2 ^ (cents * x / 1200).
|
| SampleType | fraction () const |
| | Signed unit drift, independent of the pitch walk.
|
template<typename SampleType = float>
class pulp::signal::DriftT< SampleType >
Two decorrelated OU walks presented as the two things drift is actually wired to: a pitch ratio and a unit fraction.
The walks are stepped once every kDecimation samples and interpolated between control points. An OU walk's spectrum is already low-pass — running it per sample costs a log, a sqrt, and a sincos for detail far above where drift lives — so the decimation is free in character and 32x in cost. The interpolation matters: without it the stepped control is a staircase, and a staircase on a delay length or an oscillator frequency is audible as zipper noise, not as drift.
RT contract: prepare() is control-side. next(), reset(), and the accessors allocate nothing.
USE: pitch_factor() multiplies an oscillator frequency or a resampling ratio; fraction() is a signed unit control for anything else (filter cutoff in cents, a delay-time percentage, a stereo width). Set set_cents(3) for "this is a good tape machine", 15 for "this one needs
service", 40 for seasick.