Sample and hold

Capture the input lanes whenever the trigger lane rises and hold them until the next trigger.

  • Control
  • Since 0.2.0
  • sample
  • hold
  • trigger
  • random

Open in TuneToys

Sample and hold as the Patch draws it, at default values: inlets on the left, outlets on the right.

Sample and hold captures the input lanes whenever the trigger lane rises and holds them until the next trigger.

What it does#

Between triggers the output is frozen at the last captured value. Each rising edge on the trigger lane takes a fresh snapshot of every lane of the control input. The trigger is a single lane; a narrower control input is broadcast. The node has no parameters.

When to use it#

Use it to turn a continuous source into stepped values, for example a sweeping LFO sampled by a clock, or to freeze a sensor reading on an event. A trigger can come from Compare or a square Control LFO.

Ports#

PortDirectionSignalLanes
controlInputControlInferred from the cable
triggerInputControl1
controlOutputControlInferred from the cable

Parameters#

This node has no numeric parameters.

Tips#

  • Sample a fast saw LFO with a slower clock for stepped, pseudo-random values.
  • Hold keeps the value indefinitely; a missing trigger means the output never updates.

See also#

Compare, Counter, Control LFO, Cables.

Help patches

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.

1. Sample a sweep on a clock

beginner Teaches: cables

A saw LFO is sampled by a square clock.

Patch: Oscillator audio output connected to Patch outputs audio input. Control LFO “sweep” control output connected to Sample and hold control input. Control LFO “clock” control output connected to Sample and hold trigger input.
Connections as text
  • Oscillator audio output connected to Patch outputs audio input
  • Control LFO “sweep” control output connected to Sample and hold control input
  • Control LFO “clock” control output connected to Sample and hold trigger input
  • The saw LFO feeds the control input. The square LFO feeds the trigger.
  • On each rising edge the held value updates to the current saw level; between edges it stays put.
Frame preview: Sample a sweep on a clockFrame “Sample a sweep on a clock” with 3 elements: knob Rate, text heading, knob Rate.2 HzRateSAMPLE A SWEEP ON A CLOCK0.7 HzRate
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Compare Turn any signal into a gate or trigger by comparing it to a threshold or to another signal, lane by lane, with hysteresis and tolerance.
  • 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.
  • 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.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close