Skip to main content

Object Architecture

plugindata’s object system is built on Pure Data’s foundation but enhanced with modern UI features and improved visual feedback.

Object Lifecycle

From Object.cpp:35-69, objects are created in two ways: New Object Creation:
Existing Object Reference:

Object Types

1. GUI Objects

Interactive visual elements that extend Pure Data’s standard objects: Number Boxes
  • Display and edit numeric values
  • Support mouse drag to adjust
  • Can have custom ranges and display formats
Sliders (Horizontal/Vertical)
  • Visual parameter control
  • Linear or logarithmic scaling
  • Customizable colors and ranges
Toggle/Bang
  • Binary on/off states
  • Momentary triggers
  • Visual feedback on activation
Canvas/VU Meters
  • Visual displays
  • Real-time level monitoring
  • Customizable appearance
From Object.cpp:498-503, GUI objects have special rendering:

2. Audio Objects

Signal processing objects (with ~ suffix): Oscillators
  • [osc~] - Sine wave oscillator
  • [phasor~] - Sawtooth/ramp oscillator
  • [noise~] - White noise generator
Filters
  • [lop~] - Low-pass filter
  • [hip~] - High-pass filter
  • [bp~] - Band-pass filter
  • [vcf~] - Voltage-controlled filter
Audio I/O
  • [adc~] - Audio input (analog-to-digital converter)
  • [dac~] - Audio output (digital-to-analog converter)
  • [readsf~] - Read sound file
  • [writesf~] - Write sound file
Math Operations
  • [+~], [-~], [*~], [/~] - Arithmetic
  • [clip~] - Limit signal range
  • [wrap~] - Wrap signal values

3. Control Objects

Message-based objects for logic and flow control: Flow Control
  • [select] / [sel] - Route based on value
  • [route] - Message routing by symbol
  • [spigot] - Gate messages on/off
  • [moses] - Split numbers by threshold
Timing
  • [metro] - Metronome/clock
  • [delay] / [del] - Delayed bang
  • [timer] - Measure time between events
  • [pipe] - Delay messages with values
Math and Logic
  • [+], [-], [*], [/] - Arithmetic
  • [>], [<], [==] - Comparisons
  • [&&], [||] - Logical operators
  • [expr] - Mathematical expressions
Data Structures
  • [list] - List operations
  • [array] - Data arrays
  • [table] - Lookup tables
  • [text] - Text manipulation

Object Properties

Every object has configurable properties accessible through the inspector: Position and Size
Visual Properties
  • Background color
  • Label text and position
  • Font and size
  • Send/receive symbols
Functional Properties
  • Value ranges (min/max)
  • Initial values
  • Send/receive names
  • Arguments

Iolets: Object Interfaces

From Iolet.h:12-65, iolets are the connection points on objects:

Iolet Types

Signal Iolets (Audio Rate)
  • Process continuous audio streams
  • Identified by ~ in object name
  • Visually distinct (colored when enabled)
  • Sample-accurate timing
Message Iolets (Control Rate)
  • Process discrete events
  • Handle numbers, symbols, lists
  • Event-driven execution
GEM Iolets
  • Graphics rendering chain
  • Pass GEM state between objects
  • Special visual indicator

Iolet Layout

From Object.cpp:512-586, iolet positioning is calculated:
Layout Modes:
  1. Edge Spacing (Vanilla style)
    • Iolets placed at object corners
    • Matches Pure Data vanilla appearance
  2. Centered Spacing (Default)
    • Iolets distributed evenly
    • Better visual balance
    • Easier to connect

Iolet Tooltips

From Object.cpp:589-693, tooltips are automatically populated:
Tooltips show:
  • Iolet purpose and accepted values
  • GEM state indicators
  • Signal vs message type

Connection System

The connection system manages the visual and functional links between objects.

Connection Creation

From Connection.cpp:26-95:

Connection Types

Data Connections (Message)
  • Control-rate messages
  • Discrete events and values
  • Black/base color (default)
Signal Connections (Audio)
  • Audio-rate continuous signals
  • Sample-accurate processing
  • Colored differently (configurable)
  • Multiple signal channels supported
GEM Connections
  • Graphics rendering chain
  • Special visual treatment
  • Pass rendering state

Connection Paths

plugindata supports multiple connection path styles:

1. Curved Paths (Default)

From Connection.cpp:879-932, bezier curves for smooth appearance:

2. Segmented Paths

  • Orthogonal (right-angle) routing
  • User-adjustable waypoints
  • Automatic path-finding algorithm
  • Saved with patch
From Connection.cpp:317-339, segmented paths are serialized:

3. Straight Lines

  • Direct point-to-point
  • Minimal visual overhead
  • Matches Pd vanilla

Connection Interaction

Selection
  • Click to select
  • Multiple selection with Shift
  • Selected connections highlighted
Reconnection
From Connection.cpp:749-787, reconnect handles allow redirecting:
Path Editing
  • Drag segments to adjust waypoints (segmented mode)
  • Double-click to toggle segmented/curved
  • Right-click for path options

Connection Ordering

From Canvas.cpp:824-868, connection rendering respects layering:
Ordering Display When multiple connections share an outlet, numbers show execution order.

Object Management

Canvas Object Management

From Canvas.cpp:1093-1231, synchronization with Pure Data:

Object Selection

Multiple selection modes: Click Selection
  • Single click: Select one
  • Shift + click: Add to selection
  • Cmd/Ctrl + click: Toggle selection
Lasso Selection
  • Drag on canvas to select region
  • All contained objects selected
  • Works in edit mode only
Select All
  • Cmd/Ctrl + A: Select all objects
  • Cmd/Ctrl + Shift + A: Deselect all

Object Alignment and Distribution

From Object.cpp:36-226, the ObjectsResizer handles multi-object operations:
Alignment Options:
  • Align left/right/top/bottom
  • Distribute horizontally/vertically
  • Align to grid
  • Even spacing

Advanced Features

HVCC Compatibility

From Object.cpp:139-148, objects check compatibility:
Incompatible objects are highlighted when HVCC mode is enabled.

Object Activity Visualization

From Object.cpp:479-489:
Visual feedback shows which objects are processing data in real-time.

Graph on Parent (GOP)

Subpatches can display their contents on the parent canvas:
  • Define visible area (x/y ranges)
  • Show/hide name and arguments
  • Create custom GUI objects
  • Encapsulate complex interfaces

Best Practices

  1. Object Naming: Use descriptive names for subpatches and abstractions
  2. Connection Clarity: Use segmented paths for complex patches
  3. Visual Organization: Group related objects together
  4. Performance: Minimize unnecessary signal connections
  5. Modularity: Use subpatches to organize functionality
  6. Documentation: Add tooltips and comments to objects

Next Steps

Patching Basics

Learn fundamental patching concepts

Plugin vs Standalone

Understand the different operating modes