Adjusts Curve. Range: -1–1. Default: 0. Linear scale. Units: unitless.
Adjusts Loop. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Adjusts Retrigger. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Adjusts Velocity. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Control envelope as the Patch draws it, at default values: inlets on the left, outlets on the right.
Control envelope turns a gate lane into a 0 to 1 control lane that rises, holds and falls like an envelope. It is the control-rate sibling of Envelope: the same stages and curves, but the result is a lane you cable into any parameter instead of a gain applied to audio.
While the gate lane is at 0.5 or more it is held. A rising edge starts the attack; in ADSR the level then decays to Sustain and stays there until the gate falls, then Release returns it to zero. AD ignores the falling gate and runs attack then decay on its own; AR rises to full and holds until the gate falls. Curve bends every segment, Loop repeats whole cycles while the gate is held, and Retrigger chooses whether a new edge starts from the current level or from zero. The stage logic is the audio envelope's own, so the two agree.
Velocity scales the peak from the gate lane's value at the rising edge: at 0 the gate value is ignored, at 1 a gate of 0.75 peaks at 0.75. Use the velocity lane of MIDI to control, or a gate multiplied by a level, to get velocity-sensitive envelopes. The gate must still reach 0.5 to open.
Control runs once per audio block, and the output is the level at the block's last frame. Stage times are exact, but the lane steps about 2.7 ms at 128 frames and 48 kHz, so very short attacks look like a step. Cable the output into a parameter's cable input to let that parameter smooth it.
The done outlet is 1 for one block when a cycle ends: a release finishes, or an AD decay completes. A retrigger during a release is not a completed cycle. Cable it into Counter or another trigger input.
Use it to shape a filter, a level or any parameter per note, or to build a one-shot modulator from a trigger. Prefer Envelope when the envelope shapes audio directly.
Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.
A square LFO is the gate; a control envelope turns each pulse into a swell and fade on the tone.
Oscillator
MIDI1 lane
Audio2ch
Fundamental pitch, capped below Nyquist; detune uses cents. Range: 20–20000 Hz. Default: 220 Hz. Logarithmic scale. Units: Hz.
Hz
Output gain. Range: 0–0.5 ×. Default: 0.12 ×. Linear scale. Units: linear gain.
×
Selects the implemented algorithm. Choices are discrete and are not LFO targets. Range: 0–7. Default: 0. Linear scale. Units: unitless.
Cycle offset; Gate rising edges restart phase from this position. Range: 0–1 cycles. Default: 0 cycles. Linear scale. Units: cycles.
cycles
Pitch offset in cents. Range: -1200–1200 cents. Default: 0 cents. Linear scale. Units: cents.
cents
On or off. A rising edge retriggers; held on runs the oscillator or envelope. A control cable switches it at 0.5. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Semitones a full pitch bend on the MIDI input moves the note, up or down. Range: 0–48 st. Default: 2 st. Linear scale. Units: st.
st
Time constant of the slide from one MIDI note's pitch to the next; 0 jumps. Range: 0–2000 ms. Default: 0 ms. Linear scale. Units: ms.
ms
Gain
Audio2ch
Audio2ch
Multiplies every audio channel. 0 silences the signal; 1 leaves its level unchanged. Range: 0–2 ×. Default: 1 ×. Linear scale. Units: linear gain.
×
Control LFO
Reset1 lane
Control1 lane
Cycle1 lane
Waveform of the oscillator. The random shapes draw a new value each cycle from a generator seeded by the node path, so every host and replay agrees. Range: 0–5. Default: 0. Linear scale. Units: unitless.
Cycles per second when Beats is 0. Range: 0.01–40 Hz. Default: 1 Hz. Logarithmic scale. Units: Hz.
Hz
Beats per cycle, synced to the shared transport. 0 uses Rate instead. Range: 0–64 beats. Default: 0 beats. Linear scale. Units: beats.
beats
Peak-to-peak amount of the output swing. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Centre of the swing. Range: 0–1. Default: 0.5. Linear scale. Units: unitless.
Starting phase of the cycle, and where a Reset edge restarts it. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Where the Triangle peaks, or how the Saw bends. 0.5 is the plain shape. Range: 0–1. Default: 0.5. Linear scale. Units: unitless.
Control envelope
Gate1 lane
Control1 lane
Done1 lane
Selects the implemented algorithm. Choices are discrete. Range: 0–2. Default: 0. Linear scale. Units: unitless.
Time to rise to full level. Range: 0–10000 ms. Default: 80 ms. Linear scale. Units: ms.
ms
Time to fall to sustain in ADSR, or zero in AD. Range: 0–10000 ms. Default: 200 ms. Linear scale. Units: ms.
ms
Held ADSR level. Range: 0–100 %. Default: 50 %. Linear scale. Units: percent.
%
Time to return to zero after the gate falls. Range: 0–10000 ms. Default: 400 ms. Linear scale. Units: ms.
Repeats complete envelope cycles while the gate is held. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Where a new gate edge starts the attack. Range: 0–1. Default: 0. Linear scale. Units: unitless.
How much the gate lane value at the rising edge scales the peak. 0 ignores it. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Audio output
Audio2ch
Note
Note
Patch: Oscillator audio output connected to Gain audio input. Gain audio output connected to Patch outputs audio input. Control LFO control output connected to Control envelope gate input. Control envelope control output connected to Gain @level input.Connections as text
Oscillator audio output connected to Gain audio input
Gain audio output connected to Patch outputs audio input
Control LFO control output connected to Control envelope gate input
Control envelope control output connected to Gain @level input
A gate at 0.5 or more is held; below it the envelope releases.
The output is 0 to 1 and rides the gain level.
Frame preview (static). Controls show their default values.
An AD envelope scales its peak by the gate value, and its done outlet steps a counter that picks the next pitch.
Oscillator
MIDI1 lane
Audio2ch
Fundamental pitch, capped below Nyquist; detune uses cents. Range: 20–20000 Hz. Default: 220 Hz. Logarithmic scale. Units: Hz.
Hz
Output gain. Range: 0–0.5 ×. Default: 0.12 ×. Linear scale. Units: linear gain.
×
Selects the implemented algorithm. Choices are discrete and are not LFO targets. Range: 0–7. Default: 0. Linear scale. Units: unitless.
Cycle offset; Gate rising edges restart phase from this position. Range: 0–1 cycles. Default: 0 cycles. Linear scale. Units: cycles.
cycles
Pitch offset in cents. Range: -1200–1200 cents. Default: 0 cents. Linear scale. Units: cents.
cents
On or off. A rising edge retriggers; held on runs the oscillator or envelope. A control cable switches it at 0.5. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Semitones a full pitch bend on the MIDI input moves the note, up or down. Range: 0–48 st. Default: 2 st. Linear scale. Units: st.
st
Time constant of the slide from one MIDI note's pitch to the next; 0 jumps. Range: 0–2000 ms. Default: 0 ms. Linear scale. Units: ms.
ms
Gain
Audio2ch
Audio2ch
Multiplies every audio channel. 0 silences the signal; 1 leaves its level unchanged. Range: 0–2 ×. Default: 1 ×. Linear scale. Units: linear gain.
×
Control LFO
Reset1 lane
Control1 lane
Cycle1 lane
Waveform of the oscillator. The random shapes draw a new value each cycle from a generator seeded by the node path, so every host and replay agrees. Range: 0–5. Default: 0. Linear scale. Units: unitless.
Cycles per second when Beats is 0. Range: 0.01–40 Hz. Default: 1 Hz. Logarithmic scale. Units: Hz.
Hz
Beats per cycle, synced to the shared transport. 0 uses Rate instead. Range: 0–64 beats. Default: 0 beats. Linear scale. Units: beats.
beats
Peak-to-peak amount of the output swing. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Centre of the swing. Range: 0–1. Default: 0.5. Linear scale. Units: unitless.
Starting phase of the cycle, and where a Reset edge restarts it. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Where the Triangle peaks, or how the Saw bends. 0.5 is the plain shape. Range: 0–1. Default: 0.5. Linear scale. Units: unitless.
Control LFO
Reset1 lane
Control1 lane
Cycle1 lane
Waveform of the oscillator. The random shapes draw a new value each cycle from a generator seeded by the node path, so every host and replay agrees. Range: 0–5. Default: 0. Linear scale. Units: unitless.
Cycles per second when Beats is 0. Range: 0.01–40 Hz. Default: 1 Hz. Logarithmic scale. Units: Hz.
Hz
Beats per cycle, synced to the shared transport. 0 uses Rate instead. Range: 0–64 beats. Default: 0 beats. Linear scale. Units: beats.
beats
Peak-to-peak amount of the output swing. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Centre of the swing. Range: 0–1. Default: 0.5. Linear scale. Units: unitless.
Starting phase of the cycle, and where a Reset edge restarts it. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Where the Triangle peaks, or how the Saw bends. 0.5 is the plain shape. Range: 0–1. Default: 0.5. Linear scale. Units: unitless.
Mathcontrol
A1 lane
B1 lane
Out1 lane
The lane-wise operation. Add through Absolute difference combine A and B; Negate through Sign transform A alone and ignore B. Range: 0–16. Default: 0. Linear scale. Units: unitless.
Value used for every lane of B when nothing is connected to it. Multiply with 0.5 halves a signal. Range: -8–8. Default: 0. Linear scale. Units: unitless.
Control envelope
Gate1 lane
Control1 lane
Done1 lane
Selects the implemented algorithm. Choices are discrete. Range: 0–2. Default: 0. Linear scale. Units: unitless.
Time to rise to full level. Range: 0–10000 ms. Default: 10 ms. Linear scale. Units: ms.
ms
Time to fall to sustain in ADSR, or zero in AD. Range: 0–10000 ms. Default: 250 ms. Linear scale. Units: ms.
ms
Held ADSR level. Range: 0–100 %. Default: 70 %. Linear scale. Units: percent.
%
Time to return to zero after the gate falls. Range: 0–10000 ms. Default: 200 ms. Linear scale. Units: ms.
Repeats complete envelope cycles while the gate is held. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Where a new gate edge starts the attack. Range: 0–1. Default: 0. Linear scale. Units: unitless.
How much the gate lane value at the rising edge scales the peak. 0 ignores it. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Counter
Trigger1 lane
Reset1 lane
Control2 lanes
Wrap1 lane
Count value that maps to 1 on the normalised lane and where wrapping or clamping happens. Range: 1–1000. Default: 10. Linear scale. Units: unitless.
Amount added on each trigger; negative counts down. Range: -10–10. Default: 1. Linear scale. Units: unitless.
Wrap past the limit back to 0 instead of clamping. Range: 0–1. Default: 0. Linear scale. Units: unitless.
Select lanes
ControlAuto
ControlAuto
Scale
ControlAuto
ControlAuto
Input value that maps to Output min. Range: -10000–10000. Default: 0. Linear scale. Units: unitless.
Input value that maps to Output max. Range: -10000–10000. Default: 1. Linear scale. Units: unitless.
Output at Input min. Range: -10000–10000. Default: 0. Linear scale. Units: unitless.
Output at Input max. Range: -10000–10000. Default: 1. Linear scale. Units: unitless.
Bend of the mapping: negative eases in, positive eases out, 0 is linear. Range: -1–1. Default: 0. Linear scale. Units: unitless.
Hold the output inside its range instead of extrapolating. Range: 0–1. Default: 1. Linear scale. Units: unitless.
Audio output
Audio2ch
Note
Note
Patch: Oscillator audio output connected to Gain audio input. Scale control output connected to Oscillator @frequency input. Gain audio output connected to Patch outputs audio input. Control LFO “gate” control output connected to Math a input. Control LFO “level” control output connected to Math b input. Math out output connected to Control envelope gate input. Control envelope control output connected to Gain @level input. Control envelope done output connected to Counter trigger input. Counter control output connected to Select lanes control input. Select lanes control output connected to Scale control input.Connections as text
Oscillator audio output connected to Gain audio input
Scale control output connected to Oscillator @frequency input
Gain audio output connected to Patch outputs audio input
Control LFO “gate” control output connected to Math a input
Control LFO “level” control output connected to Math b input
Math out output connected to Control envelope gate input
Control envelope control output connected to Gain @level input
Control envelope done output connected to Counter trigger input
Counter control output connected to Select lanes control input
Select lanes control output connected to Scale control input
Velocity 1 makes the gate value the peak; 0 ignores it.
done is 1 for one block when the envelope ends.
Frame preview (static). Controls show their default values.
Envelope Curved AD, AR and ADSR gain envelopes with looping and explicit retrigger behavior.
Control LFO A free-running or tempo-synced low-frequency oscillator on a control lane, 0 to 1, with depth, offset, phase, skew, random shapes and a reset input.
Counter Count rising edges of a trigger lane, with step, limit, wrap and reset. Lane 1 is the normalised count, lane 2 the raw count.
MIDI to control Turn MIDI into six control lanes: pitch, gate, velocity, bend, pressure and one CC, with last-note priority.