Envelope / Control
Per-note linear ramp. It starts at from when the voice starts, moves to to during the requested sample length, and then holds the final value.
to.Use 4410 for about 0.1 seconds, 22050 for about 0.5 seconds, 44100 for about 1 second, and 88200 for about 2 seconds in the 44.1k reference domain.
fromtoin(0.05, 0.45, 44100)
moog(saw(X), 0.03+0.42*fromtoin(0.0,1.0,22050), 0.35)
sin(X + 0.35*sin(2*X)*fromtoin(0.0,1.0,12000))
fromtoin() follows the same per-voice time base as pos(), attack(), and release(). Every new note starts its own ramp from from, which makes it useful for one-shot filter opens, modulation-depth fades, phase movement, and evolving attack color.
For pitched oscillator functions, X already contains the current MIDI note pitch and transpose information. Prefer saw(X), sin(X), or pwm(X, 0.4) unless you intentionally want an octave or ratio shift such as 0.5*X or 2*X.