Overview
The[playhead] object receives playhead information from the DAW, including transport state, timing, tempo, and position data. This object only works in the plugin version of plugdata.
With [playhead], you can synchronize your patches with the DAW’s timeline, respond to transport changes, and create tempo-synchronized effects.
Outlets
Playing stateOutputs
1 if the DAW is playing, 0 otherwise. Use this to trigger actions when playback starts or stops.Recording stateOutputs
1 if the DAW is recording, 0 otherwise.Loop informationOutputs a list of three floats:
<loop_active, loop_start, loop_end>- First value:
1if looping is enabled,0otherwise - Second value: Loop start position (in PPQ)
- Third value: Loop end position (in PPQ)
0.Edit timeThe current edit time in the DAW (useful for offline processing).
Frame rateThe DAW’s frame rate (frames per second). Common values include 24, 25, 30, 60, etc.
BPM (Tempo)The current tempo in beats per minute. Use this to create tempo-synchronized effects.
Last bar positionThe position of the last bar in the timeline (in PPQ).
Time signatureA list containing the time signature information:
<numerator, denominator>For example, 4/4 time outputs 4 4, and 6/8 time outputs 6 8.Position informationA list of three floats providing the current playhead position in different formats:
- PPQ position: Position in Pulses Per Quarter note (musical time)
- Time in samples: Position in sample frames
- Time in seconds: Position in seconds
16.0 176400 4.0 (at 4 seconds, 16 quarter notes, 176400 samples at 44.1kHz)Usage Example
Advanced Example: Beat Counter
Notes
- This object only works in plugin mode, not in standalone
- Position data is provided in multiple formats for convenience
- PPQ (Pulses Per Quarter) is the standard MIDI timing format
- All outlets update whenever the playhead information changes
- Use
[change]objects to detect when specific values change if needed
