Skip to main content

Overview

plugindata provides deep integration with digital audio workstations (DAWs) through industry-standard plugin formats. This allows Pure Data patches to work seamlessly within modern music production workflows.

Plugin Formats

plugindata is available in multiple plugin formats:
  • VST3 - Steinberg’s cross-platform format (Windows, macOS, Linux)
  • AU - Apple Audio Units (macOS only)
  • LV2 - Open-source format (Linux primarily)
  • CLAP - Modern open plugin standard (all platforms)
Each format provides the same core functionality with platform-specific optimizations.

Transport Synchronization

Playhead Information

From PluginProcessor.cpp:1055-1128, plugdata receives comprehensive transport data:

Accessing Transport Data in Pd

Use receive objects to access playhead information:
Available Receivers:

Tempo Sync Example

Position-Based Triggering

Automation

Parameter System

From PluginProcessor.cpp:120-131, plugdata exposes automation parameters:
Default Configuration:
  • 1 volume parameter (param0/volume)
  • 64 general automation parameters (param1-param64)
  • Range: 0.0 to 1.0 (normalized)
  • Saved with DAW project

Parameter Sending

From PluginProcessor.cpp:1149-1159, parameters are efficiently updated:
Parameters are only sent when they change, minimizing overhead.

Using Automation in Pd

Receive Parameter Values:
Multiple Parameters:
Bi-directional Control:
Sending values back to parameters from Pd can conflict with DAW automation. Use carefully and consider disabling parameter sending when DAW automation is active.

Parameter Mapping

Linear Scaling:
Exponential Scaling (for frequency):
Stepped Values:

MIDI Routing

MIDI Input Processing

From PluginProcessor.cpp:1166-1201, MIDI is processed and sent to Pd:

MIDI in Pure Data

Note Messages:
Control Change:
Pitch Bend:
Complete MIDI Input:

MIDI Output

Send MIDI from Pd back to the DAW:
Complete MIDI Output:

Multi-Timbral Setup

DAW MIDI can address 16 channels per device:

Sample Rate Handling

Sample Rate Adaptation

From PluginProcessor.cpp:699-759, plugdata adapts to DAW sample rate:
Supported Sample Rates:
  • 44.1 kHz (CD quality)
  • 48 kHz (standard digital)
  • 88.2 kHz (2x oversample of 44.1)
  • 96 kHz (2x oversample of 48)
  • 176.4 kHz (4x oversample of 44.1)
  • 192 kHz (4x oversample of 48)
  • Any DAW-specified rate

Sample Rate in Pd

Access current sample rate:
Use for sample-rate-independent delays:

Buffer Size Handling

Block Size Adaptation

Pure Data processes in fixed 64-sample blocks, but DAWs use variable buffer sizes. From PluginProcessor.cpp:724-758:

Processing Modes

Constant Block Size (optimized):
  • DAW buffer is multiple of 64 samples
  • Direct processing without buffering
  • Lower latency
  • Used in standalone mode when possible
Variable Block Size (adaptive):
  • DAW buffer is arbitrary size
  • FIFO buffering required
  • Slightly higher latency
  • Always used in plugin mode
From PluginProcessor.cpp:941-989:

Latency Compensation

From PluginProcessor.cpp:192:
plugindata reports 64 samples of algorithmic latency to the DAW, which automatically compensates by:
  • Delaying other tracks
  • Adjusting playback timing
  • Maintaining phase alignment
Additional latency from oversampling is also reported:

Session Management

State Saving

From PluginProcessor.cpp:1224-1308, complete state is saved:
Saved Data:
  • Complete patch content (embedded)
  • Parameter values
  • Oversampling settings
  • Editor size and position
  • Connection paths (segmented)
  • Custom state data
  • Plugin version

State Loading

State is restored when DAW project opens:

Performance Optimization

CPU Load Management

From PluginProcessor.cpp:744:
CPU usage is measured and displayed in the status bar.

Audio Thread Safety

From PluginProcessor.cpp:825-938, processing is thread-safe:

Best Practices

Optimizing for DAW Use

Minimize CPU Usage:
  • Use efficient algorithms
  • Disable unused signal paths
  • Consider oversampling cost
  • Monitor CPU meter
Handle Automation Smoothly:
Tempo Sync Correctly:
MIDI Latency:
  • MIDI is processed per-block (64 samples)
  • For tighter timing, reduce DAW buffer size
  • Consider MIDI->audio jitter in timing-critical applications

Testing in DAW

  1. Test automation recording and playback
  2. Verify tempo sync at different BPMs
  3. Check MIDI routing and channel handling
  4. Test state recall (save/load project)
  5. Monitor CPU usage under load
  6. Test multiple instances for efficiency
  7. Verify latency compensation with other tracks

Troubleshooting

Common Issues

No Sound
  • Check DAW routing to plugin
  • Verify [dac~] connections in patch
  • Check output channel configuration
  • Ensure DSP is enabled (should be automatic)
Automation Not Working
  • Verify parameter receivers: [r param1]
  • Check DAW automation is enabled
  • Test with simple patch first
  • Look for parameter conflicts
Transport Not Syncing
  • Check receivers: [r __playhead ...]
  • Test with simple tempo display
  • Verify DAW is sending transport
  • Check if transport is playing
High CPU Usage
  • Disable oversampling if not needed
  • Optimize Pd patch efficiency
  • Check for unnecessary computations
  • Use [block~] for lower rates where possible
MIDI Not Received
  • Verify MIDI track routes to plugin
  • Check MIDI channel filtering
  • Test with [notein] + [print]
  • Ensure DAW MIDI output is enabled

Next Steps

Plugin vs Standalone

Understand the differences between operating modes

Patching Basics

Master Pure Data patching fundamentals