Gain Node

The Gain Node is a simple Node that changes the gain level (volume) of an audio signal. In technical terms, it simply multiplies each sample in the source audio signal (or control signal), increasing or decreasing the signal’s amplitude.

This is one of the simplest effects in audio signal processing.


Inputs

Audio Input

An audio signal (or control signal) to change.

Gain-Control Input

A control signal to automate the Gain setting. You can toggle this input from the Node properties panel (it’s not enabled by default). You can also connect to this input, but only mono sources are supported. If you connect a multi-channel audio signal, it’s automatically downmixed to mono.

Note: if a non-clamped Mode setting is selected, even though the Gain Node’s UI only allows setting the gain between 0 and 2, this input will accept any value. This can result in extremely loud audio, if care is not taken.


Settings

Gain

The gain change (or volume change) to apply. The meaning of this value depends on the Mode setting. For example, with a Linear or Linear (clamped) mode, this value acts as a multiplier, where a value of 1 results in no change, a value of 0.5 reduces gain (or volume) by half, and a value of 2.0 doubles the gain.

Boost

★ With AudioNodes HD

Convenience setting to further amplify output gain.

Mode

★ With AudioNodes HD

Specifies whether gain change will be interpreted as decibels or volume percent.

  • Linear: gain change as volume percent
  • Decibels: gain change as decibels
  • Linear (clamped): gain change as volume percent, being clamped before processing (see the blogpost mentioning the clamp)
  • Decibels (clamped)gain change as decibels, being clamped before processing

Outputs

Audio Output

The audio signal (or control signal) with the specified gain change applied.

This output supports constant folding in multiple cases. Specifically, if any of the following 4 conditions is true, this output will be constant:

  • The Audio Input is constant and the Gain setting is not input-controlled
  • The Audio Input is constant and the Gain-Control Input is input-controlled with a constant value
  • The Gain setting is 0
  • The Gain-Control Input is given a constant 0

In most cases, this output will have the same channel count as the Audio Input. However, if the Gain setting 0 (or is controlled with a constant 0), then the channel count is always 1, because the output is also a constant-0.


Similar Nodes

  • Multiply Node – multiples a signal the same way as the Gain Node, but its UI and input structure is specifically for multiplying a signal with another, and has better support for multi-channel multiplication