home/ atoms/ renardo-linvar

Renardo's `linvar()` interpolates values linearly across its duration, unlike the step-wise `var()`

While var() steps instantly between values at boundary points, linvar() computes a linear interpolation between the current and next value over the duration, producing a smooth sweep. linvar([500, 5000], 8) at beat 4 returns 2750 Hz. This makes it ideal for filter sweeps, rate ramps, and amplitude fades. The interpolation formula is current * (1-proportion) + next * proportion where proportion is how far through the current duration we are. Variants include sinvar (sinusoidal ease in/out), expvar (exponential curve), xvar/yvar (cosine/sine trigonometric). Mixing linvar with var lets you shape dynamics and timbre over time from a single line.

Examples

hh >> play("--", rate=linvar([1, 2], [8, 0]))  # rate sweep over 8 beats then instant reset
p1 >> pluck([0,2,4], lpf=linvar([500, 5000], 16))  # filter sweep
p1 >> pluck([0,2,4], amp=sinvar([0.2, 1], 8))  # volume with sinusoidal ease

Assessment

Explain why lpf=var([200, 2000], 8) sounds different from lpf=linvar([200, 2000], 8). When would you choose each?

“class linvar(TimeVar): def now(self, time=None): """ Returns the value currently represented by this TimeVar """”
corpus · renardo-python-over-supercollider-foxdot-successor-with-buil · chunk 82