How DAWs Record Automation from MIDI Streams
This article explains how digital audio workstations (DAWs) capture continuous incoming MIDI streams and translate them into editable, smooth vector automation curves. It covers the end-to-end technical process, including MIDI message reception, parameter scaling, data thinning algorithms, and Bézier curve interpolation, breaking down how discrete digital events become continuous visual and musical automation lines.
1. Ingestion of Discrete MIDI Messages
Hardware MIDI controllers do not output continuous analog voltage curves; they output discrete digital serial packets. When a user turns a knob, fader, or modulation wheel, the controller transmits standard MIDI Continuous Controller (CC), Pitch Bend, or Channel Pressure (Aftertouch) messages.
- Resolution: Standard MIDI CC values are 7-bit, providing 128 discrete steps (values 0 to 127). High-resolution MIDI uses paired CC messages or MIDI 2.0 to deliver 14-bit (16,384 steps) or 32-bit resolution.
- Timestamping: The operating system's audio/MIDI framework (such as CoreMIDI on macOS, WASAPI/WinMM on Windows, or ALSA on Linux) receives these packets and attaches an accurate sample-accurate timestamp relative to the audio buffer.
- Buffering: The DAW reads these timestamped packets into an input buffer during each audio processing cycle, aligning the incoming MIDI events precisely with the timeline position of the playhead.
2. Parameter Mapping and Value Normalization
Once ingested, the DAW must match the raw MIDI message to an internal software parameter, such as a synthesizer's filter cutoff or a mixer channel's volume fader.
- Target Assignment: The DAW checks its internal mapping table (via MIDI Learn or hardcoded mappings) to link the incoming channel and CC number to a target parameter ID.
- Normalization: Raw values (e.g., 0–127) are
normalized into a floating-point range, typically between
0.0and1.0. - Taper and Scaling: Most audio parameters are
non-linear (such as logarithmic volume faders or exponential frequency
ranges). The DAW applies a transfer function to convert the normalized
0.0–1.0input into the target parameter's actual unit scale (e.g., decibels or Hertz).
3. Data Thinning and Noise Reduction
Recording a fast-moving physical controller can generate hundreds of MIDI messages per second. Writing a separate automation node for every single MIDI message creates cluttered lanes, increases project file size, and strains CPU processing. To solve this, the DAW applies real-time or post-capture thinning algorithms:
- Threshold Filtering: The DAW ignores successive incoming values that fall below a minimum change threshold unless a specified time interval has elapsed.
- Decimation Algorithms: Algorithms such as the Ramer-Douglas-Peucker (RDP) algorithm analyze the recorded sequence of points. The algorithm identifies points that lie along a near-straight line and removes them, keeping only the essential inflection points that define the trajectory and velocity of the movement.
4. Vectorization and Curve Generation
To transform discrete, stepped data points into a smooth automation envelope, the DAW generates mathematical curves between the surviving points:
- Node Creation: The thinned data points are converted into discrete automation nodes containing timeline coordinates (time and value).
- Bézier and Spline Interpolation: Instead of connecting points with rigid, linear segments (which can cause audible "zipper noise" or stepping artifacts), the DAW calculates tangent vectors between nodes. This creates cubic Bézier or Hermite curves that generate a continuous, analog-style transition across the audio timeline.
5. Automation Modes and State Committing
The DAW incorporates incoming automation according to the selected track automation mode:
- Write: Overwrites all existing automation across the timeline while the playhead moves, regardless of whether a control is actively sending new data.
- Touch: Begins recording and overwriting existing automation only when incoming MIDI data is actively detected (or when a capacitive touch sensor on the hardware is engaged). When the stream stops, the curve smoothly returns to the pre-existing automation line via a user-defined ramp time.
- Latch: Starts overwriting existing automation upon receiving the first MIDI message, but stays at the last received value even after the input stops, until playback is halted.
Finally, the generated vector nodes and curve coefficients are written into the DAW project’s automation lane data structure in memory and committed to the session file upon saving. During playback, the DAW reads this curve and continuously interpolates floating-point values at audio-rate or control-rate to drive the target plugin parameter.