SynthMaker Manual Help Open SynthMaker (opens in a new tab)
Circuits

The analog switch

An analog switch joins two points or keeps them apart, and a voltage decides which. With a capacitor after it, it grabs a voltage and keeps it: this page builds a sample and hold from one switch: the stepped random voltage that makes a filter jump.

New words

An analog switch is a resistor with two values (S1 a b c+ c-): small while its control voltage is high, huge while it is low.

A track and hold is a switch and a capacitor: while the switch is closed the capacitor follows the input, and when it opens it keeps the last voltage.

Switch Sample and Hold's Patch: an Oscillator set to Noise into SwitchHold, a copper circuit box with its schematic in small, an LFO wired into its clk; its out wired into a Filter's env; a keyboard below.
Hold a low key: the filter jumps to a new place on every eighth note. Double-click SwitchHold to open its parts list. Open the example sound: Switch Sample and Hold ↗ (opens in a new tab)

1Writing one

Write a switch as S, the two points it joins, then the two points its control voltage is measured between:

S1 a b c+ c- [on 100] [off 100M] [at 2.5V]
  • While c+ is more than at volts above c−, the switch is its on resistance; otherwise it is its off resistance. If you leave them out, they are 100 Ω, 100 MΩ and 2.5 V.
  • The control takes no current, so it can watch any point without changing it.
  • A circuit with a switch runs at 2× unless it says otherwise.

2Track, then hold

A switch and a capacitor make a track and hold: the capacitor follows the input while the switch is closed, and keeps its voltage when it opens. Close it with a square clock, and it follows for half of each cycle and holds for the other half.

For a sample and hold, close it for just a moment. In Switch Sample and Hold the clock comes through Cp, so only the moment the clock goes high lifts g, and Rp lets it fall back: the switch stays closed for only about 0.14 ms. On each clock it closes for that moment, C1 takes on the noise, and holds it until the next: a new random voltage on every eighth note, wired into a filter. U1 lets the filter read C1 without draining it.

SwitchHold · the parts list
# A sample and hold from one switch. S1 joins the noise at in to C1 while g is over 2.5 V. The clock's square comes# through Cp, so only the clock going high lifts g, and Rp lets it fall back: the switch closes for about 0.14 ms on each# clock, C1 takes on the noise, and holds it until the next. U1 lets the filter read C1 without draining it.circuit SwitchHold  setting input: 1 V  in clk: from 0 V to 5 V  Cp clk g 1n  Rp g gnd 100k  S1 in h g gnd  C1 h gnd 10n  U1 h out out opampend
SwitchHold's schematic: the switch S1 from in to h, C1 from h to ground, the op-amp U1 as a buffer to out; the clk input through Cp to g, with Rp to ground.
The same parts list, drawn: the switch is labelled with what closes it.

3Its limits

  • A switch acts where its control crosses at, even between two samples: SynthMaker takes that step again in pieces, and the switch moves at the crossing.
  • A circuit holds up to 4 switches, and a comparator written open counts as one.
  • It is ideal: two resistances and nothing else. None of a real switch chip's quirks: no click as it switches, no on resistance that moves with the signal, no gap as it changes over.

Try it

  1. Open Switch Sample and Hold and hold a low key.
  2. In the parts list, delete Cp and Rp and change S1 in h g gnd to S1 in h clk gnd: now it tracks the noise for half of every clock, and holds for the other half.
  3. Change C1 h gnd 10n to 10u: the moment is too short to fill it, so the steps get small.
  4. Set the clock's Sync from 1/8 to 1/4: a new step on every beat.
Open the example sound: Switch Sample and Hold ↗ (opens in a new tab)

Remember