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
FromObject.cpp:35-69, objects are created in two ways:
New Object Creation:
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
- Visual parameter control
- Linear or logarithmic scaling
- Customizable colors and ranges
- Binary on/off states
- Momentary triggers
- Visual feedback on activation
- Visual displays
- Real-time level monitoring
- Customizable appearance
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
[lop~]- Low-pass filter[hip~]- High-pass filter[bp~]- Band-pass filter[vcf~]- Voltage-controlled filter
[adc~]- Audio input (analog-to-digital converter)[dac~]- Audio output (digital-to-analog converter)[readsf~]- Read sound file[writesf~]- Write sound file
[+~],[-~],[*~],[/~]- 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
[metro]- Metronome/clock[delay]/[del]- Delayed bang[timer]- Measure time between events[pipe]- Delay messages with values
[+],[-],[*],[/]- Arithmetic[>],[<],[==]- Comparisons[&&],[||]- Logical operators[expr]- Mathematical expressions
[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- Background color
- Label text and position
- Font and size
- Send/receive symbols
- Value ranges (min/max)
- Initial values
- Send/receive names
- Arguments
Iolets: Object Interfaces
FromIolet.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
- Process discrete events
- Handle numbers, symbols, lists
- Event-driven execution
- Graphics rendering chain
- Pass GEM state between objects
- Special visual indicator
Iolet Layout
FromObject.cpp:512-586, iolet positioning is calculated:
-
Edge Spacing (Vanilla style)
- Iolets placed at object corners
- Matches Pure Data vanilla appearance
-
Centered Spacing (Default)
- Iolets distributed evenly
- Better visual balance
- Easier to connect
Iolet Tooltips
FromObject.cpp:589-693, tooltips are automatically populated:
- 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
FromConnection.cpp:26-95:
Connection Types
Data Connections (Message)- Control-rate messages
- Discrete events and values
- Black/base color (default)
- Audio-rate continuous signals
- Sample-accurate processing
- Colored differently (configurable)
- Multiple signal channels supported
- Graphics rendering chain
- Special visual treatment
- Pass rendering state
Connection Paths
plugindata supports multiple connection path styles:1. Curved Paths (Default)
FromConnection.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
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
From
Connection.cpp:749-787, reconnect handles allow redirecting:
- Drag segments to adjust waypoints (segmented mode)
- Double-click to toggle segmented/curved
- Right-click for path options
Connection Ordering
FromCanvas.cpp:824-868, connection rendering respects layering:
Object Management
Canvas Object Management
FromCanvas.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
- Drag on canvas to select region
- All contained objects selected
- Works in edit mode only
- Cmd/Ctrl + A: Select all objects
- Cmd/Ctrl + Shift + A: Deselect all
Object Alignment and Distribution
FromObject.cpp:36-226, the ObjectsResizer handles multi-object operations:
- Align left/right/top/bottom
- Distribute horizontally/vertically
- Align to grid
- Even spacing
Advanced Features
HVCC Compatibility
FromObject.cpp:139-148, objects check compatibility:
Object Activity Visualization
FromObject.cpp:479-489:
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
- Object Naming: Use descriptive names for subpatches and abstractions
- Connection Clarity: Use segmented paths for complex patches
- Visual Organization: Group related objects together
- Performance: Minimize unnecessary signal connections
- Modularity: Use subpatches to organize functionality
- Documentation: Add tooltips and comments to objects
Next Steps
Patching Basics
Learn fundamental patching concepts
Plugin vs Standalone
Understand the different operating modes
