Gain

A clean multichannel gain stage.

  • Utility
  • Since 0.1.0
  • level
  • volume
  • utility

Open in TuneToys

Used in the templates Warm Echo, Two Gain Stages.

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

Gain multiplies a signal by a number. It is the simplest way to turn something up or down.

What it does#

Every channel of the incoming audio is multiplied by Level. A level of 0 is silence, 1 leaves the signal unchanged and 2 doubles it. Gain changes only the level: it adds no tone, delay or filtering. The change is smoothed so moving the control does not click.

When to use it#

Use it to trim a loud source before an effect, to set the final level of a Toy, or as the node you expose as a master volume. To combine several signals use Mixer; to blend two use Crossfade.

Ports#

PortDirectionSignalLanes
audioInputAudioInferred from the cable
audioOutputAudioInferred from the cable

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
levelLevel0 to 21linearlinearMultiplies every audio channel. 0 silences the signal; 1 leaves its level unchanged.

Level (level)#

The multiplier applied to every channel, from 0 to 2. Values above 1 boost the signal and can push the output past full scale. Put a Limiter after a boost you cannot avoid.

Tips#

  • Gain is linear, not decibels. Halving the value is roughly a 6 dB cut.
  • A gain of 1 is a good default for a pass-through node you plan to expose later.
  • Gain works the same on mono, stereo and larger bundles.

See also#

Mixer, Crossfade, Limiter.

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. Turn it down: a level control

beginner Teaches: level

A gain stage between a tone and the output.

Patch: Oscillator audio output connected to Gain audio input. Gain audio output connected to Patch outputs audio input.
Connections as text
  • Oscillator audio output connected to Gain audio input
  • Gain audio output connected to Patch outputs audio input
  • Gain multiplies the signal: 0 is silence, 1 leaves it unchanged, 2 doubles it.
Frame preview: Turn it down: a level controlFrame “Turn it down: a level control” with 2 elements: text heading, knob Level.TURN IT DOWN: A LEVEL CONTROL1 linearLevel
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Mixer Sum up to 32 channels, each with gain, pan, mute and solo, into one mix with a master level. Plug a cable in to add a channel.
  • Mixer Sum up to 32 channels, each with gain, pan, mute and solo, into one mix with a master level. Plug a cable in to add a channel.
  • Limiter Linked or independent sample-peak limiting with hold and adaptive release.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close