sfromtoin()

sfromtoin(stay, from, to, samples)

Category

Envelope / Control

Description

Per-note hold-and-ramp envelope. It holds from for the first stay samples of the note, then moves linearly from from to to during samples, and finally holds to.

Arguments

Typical Values

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.

Example

sfromtoin(8000, 0.10, 0.70, 32000)
moog(saw(X), 0.03+0.40*sfromtoin(6000,0.0,1.0,24000), 0.32)
sin(X + 0.25*sin(2*X)*sfromtoin(12000,0.0,1.0,44100))

Notes

sfromtoin() follows the same per-voice time base as pos(), attack(), release(), and fromtoin(). The timing is kept in the 44.1k reference sample domain, so oversampling and host sample-rate changes do not make the envelope run faster or slower.

Use sfromtoin() when a sound should stay stable for a short time before it begins to open, brighten, fade, or morph. Use fromtoin() when the ramp should start immediately at note-on.