Skip to main content

Audio Routing

This guide covers everything you need to know about routing audio and MIDI in plugdata, from basic stereo I/O to complex multichannel configurations.

Understanding Audio in Plugdata

Signal Flow

Audio flows through plugdata in this order:
1

Audio Input

Physical inputs or DAW tracks enter via [adc~] objects
2

Signal Processing

Audio-rate objects (marked with ~) process signals
3

Audio Output

Processed audio exits via [dac~] to physical outputs or DAW
Key Concepts:
  • Sample Rate - Samples per second (44100, 48000, 96000 Hz)
  • Block Size - Samples processed per cycle (affects latency)
  • Channels - Separate audio streams (mono=1, stereo=2, etc.)
  • Signal vs Message - Audio runs at sample rate, messages at block rate

Audio Input with [adc~]

Basic Input

The [adc~] object receives audio from external sources:
[adc~]              # All enabled inputs
  |
[dac~]              # Pass through to output

Channel Selection

Specify which input channels to use:
Receive left and right channels:
[adc~ 1 2]        # Channels 1 and 2 (L/R)
  |   |
  |   [*~ 0.5]    # Process right channel
  |   |
[dac~ 1 2]        # Output to L/R
Channel numbers start at 1. Available channels depend on your audio interface configuration.

Monitoring Input Levels

Visualize input levels:
[adc~ 1 2]          # Stereo input
  |   |
  |   [env~]          # Envelope follower
  |     |
  |   [- 100]         # Convert to dB
  |     |
  |   [nbx]           # Display level
  |
[*~ 0]              # Mute (monitoring only)

Audio Output with [dac~]

Basic Output

The [dac~] object sends audio to external destinations:
[osc~ 440]          # Generate tone
  |
[*~ 0.5]            # Volume
  |
[dac~]              # Output to all enabled channels

Stereo Output

Most common configuration:
# Stereo synth voice
[osc~ 440]          # Oscillator
  |
[*~ 0.5]            # Amplitude
  |
  +------+
  |      |
[dac~ 1 2]          # Left and right output

Panning

Distribute mono signal across stereo field:
[osc~ 440]          # Mono source
  |
  +--------+
  |        |
[*~]      [*~]      # Left/right gain
  |        |
[dac~ 1 2]          # Stereo output
  ^
  |
[hsl]               # Pan control (0-1)
  |
[pack 0 0]
  |
[expr $f1; 1-$f1]   # Calculate L/R gains
Or use the ELSE library:
[osc~ 440]
  |
[pan~ 0]            # Pan position -1 to 1
  |   |
[dac~ 1 2]

Multichannel Output

Route to multiple outputs:
# Quad output (4 speakers)
[noise~]            # Noise source
  |
  +-------+-------+-------+
  |       |       |       |
[dac~ 1   2       3       4]
# Front-L Front-R Rear-L Rear-R

Multichannel Patches

Configuring Channels

Set up multichannel I/O:
1

Standalone Mode

Settings > Audio > Select input/output channels to enable
2

Plugin Mode

Configure in your DAW:
  • Set track input/output channel count
  • Route hardware or virtual channels
  • Check plugin I/O configuration

Multichannel Processing

Process multiple channels efficiently:
# 8-channel reverb
[adc~ 1 2 3 4 5 6 7 8]      # 8 inputs
  |   |   |   |   |   |   |   |
  |   |   |   |   |   |   |   [freeverb~]  # Reverb each
  |   |   |   |   |   |   |   |
[dac~ 1 2 3 4 5 6 7 8]      # 8 outputs

Matrix Routing

Create flexible routing matrix:
# Simple 4x4 matrix
[adc~ 1 2 3 4]      # 4 inputs
  |   |   |   |
  |   |   |   +---[*~ 0]---+
  |   |   +-------[*~ 0]---+---[+~]---[dac~ 4]
  |   +-----------[*~ 0]---+---[+~]---[dac~ 3]
  +---------------[*~ 1]---+---[+~]---[dac~ 2]
                  [*~ 0]---+---[+~]---[dac~ 1]
                  
# Control with matrix of number boxes or sliders
Use abstractions to create reusable multichannel processors. Pass channel count as argument.

Channel Configuration

Standalone Channel Setup

Settings > Audio > Input Channels
  • Enable needed input channels
  • Disable unused channels to save CPU
  • Test with [adc~] and [env~]
  • Check physical connections
Settings > Audio > Output Channels
  • Enable output channels for your setup
  • Match your speaker/monitor configuration
  • Test with [osc~] to each output

Plugin Channel Setup

In DAW mode:
  1. Set track channel count in DAW
  2. Insert plugdata on multichannel track
  3. Configure routing in patch with [adc~] and [dac~]
  4. Enable channels as needed in DAW mixer
Common Configurations:
  • Mono - 1 in, 1 out (single instruments)
  • Stereo - 2 in, 2 out (most common)
  • Quad - 4 in, 4 out (surround)
  • Multi - Any configuration for stems/busses

MIDI Routing

MIDI Input

Receive MIDI messages:
Receive note on/off:
[notein]          # Receive notes
  |    |    |
  |    |  [print channel]
  |  [print velocity]  
[print pitch]
Or for specific channel:
[notein 1]        # Channel 1 only

MIDI Output

Send MIDI messages:
# Send notes
[makenote 100 500]  # Velocity 100, duration 500ms
  |    |
[noteout 1]         # Send to MIDI channel 1

# Send CC
[pack 0 0]
  |
[ctlout 1]          # CC number, value, channel

# Send pitch bend  
[*  8192]           # Scale
  |
[+ 8192]            # Offset
  |
[bendout 1]         # Channel 1

MIDI to Audio

Convert MIDI to audio signals:
# Simple synth
[notein]            # Receive MIDI
  |    |
  |  [/ 127]        # Normalize velocity
  |    |
[mtof] |
  |    |
[osc~] |
  |    |
  +----+
     |
   [*~]             # Apply velocity
     |
   [*~ 0.5]         # Master volume
     |
   [dac~]
Use [mtof] to convert MIDI note numbers to frequency in Hz.

Managing Latency

Understanding Latency

Total latency comes from:
  1. ADC latency - Analog to digital conversion
  2. Buffer latency - Processing buffer size
  3. DAC latency - Digital to analog conversion
  4. Plugin latency - Additional processing delay
Formula:
Latency (ms) = (Buffer Size / Sample Rate) × 1000

Example: (256 samples / 48000 Hz) × 1000 = 5.33ms

Buffer Size Selection

Choose based on your needs:
Buffer: 64-128 samplesPros:
  • Minimal delay (1.5-3ms at 48kHz)
  • Good for live performance
  • Real-time MIDI input feels responsive
Cons:
  • Higher CPU usage
  • Risk of audio dropouts
  • May not work on slower systems
Best for:
  • Live instrument playing
  • MIDI controllers
  • Real-time effects

Latency Monitoring

Check current latency:
  1. Statusbar - Displays current latency in ms
  2. Settings - Audio panel shows buffer size
  3. DAW - Check plugin delay compensation settings

Reducing Latency

1

Decrease Buffer Size

Settings > Audio > Reduce buffer size (if system can handle it)
2

Optimize Patch

  • Remove unnecessary processing
  • Disable unused GUI updates
  • Use efficient objects
3

Adjust Sample Rate

Lower sample rate = less CPU, but less frequency response
4

Use ASIO (Windows)

ASIO drivers typically offer lower latency than DirectSound
Very small buffer sizes may cause audio crackling or dropouts. Increase buffer if you hear glitches.

Advanced Routing Techniques

Send/Return Buses

Create effect sends:
# Main signal
[adc~ 1 2]          # Input
  |   |
  |   +--------[send~ reverb_send]  # Send to reverb
  |   |
[dac~ 1 2]          # Dry output

# Reverb return
[receive~ reverb_send]
  |   |
[freeverb~]         # Reverb effect
  |   |
[*~ 0.3]            # Wet level
  |   |
[dac~ 1 2]          # Add to output

Sidechain Routing

Use one signal to control another:
# Sidechain compression
[adc~ 1]            # Main signal (bass)
  |
[*~]                # VCA
  |
[dac~ 1]
  ^
  |
[- 1]               # Invert
  |
[env~]              # Envelope follower
  |
[adc~ 2]            # Control signal (kick)

Multi-Effect Chains

Route signal through multiple effects:
[adc~ 1 2]
  |   |
[lop~ 2000]         # EQ
  |   |  
[compressor~]       # Dynamics
  |   |
[chorus~]           # Modulation
  |   |
[freeverb~]         # Reverb
  |   |
[dac~ 1 2]

Troubleshooting Audio

Check:
  • DSP enabled (power button in statusbar)
  • Volume not at zero
  • Correct output device selected
  • [dac~] connected properly
  • Audio not muted in DAW (plugin mode)
Solutions:
  • Increase buffer size
  • Close other applications
  • Simplify patch
  • Check CPU meter
  • Update audio drivers
Verify:
  • Channel numbers in [adc~] and [dac~]
  • Physical cable connections
  • Audio interface channel mapping
  • DAW routing (plugin mode)
Fixes:
  • Reduce buffer size
  • Use ASIO drivers (Windows)
  • Close unnecessary programs
  • Check DAW delay compensation settings

Next Steps

You now understand audio routing in plugdata:

Build docs developers (and LLMs) love