Audio properties
The audio level track scripts can drive, and how the farm's mix and the editor's preview each consume it.
The per-layer audio level track the farm's mix applies as gain - on audio layers, on layers whose paint reaches a video fill, and on precomp and component-instance buses, where it composes over everything beneath. A script-driven level is folded on the farm (the mix consumes the driven decibels per block); the editor's waveform lanes and browser preview audio play the authored track.
Every pattern below is readable from scripts through prop() and layer.prop(); ids in a pattern (like <effect_id>) stand for the entity's real id. Every pattern here is in the drive set: scripts may WRITE each one with set() or a single-output return, per frame.
| Pattern | Wire kind | Units | Reads | Writes |
|---|---|---|---|---|
audio.level | scalar | dB (-96..+12) | yes | drive set |
Worked examples
audio.level is the decibel gain the farm's mix applies to a host - an audio layer, a layer whose paint reaches a video fill, or a precomp / component-instance bus, where it composes over everything beneath it (additive in decibels). It animates like any scalar and a script may drive it: the farm folds the script per frame ahead of its mix and applies the driven level per block, so the render hears the script. The Audio level row keeps the AUTHORED level (marked as script-driven), while the editor's waveform lanes and browser preview audio read the EVALUATED level - sample_property mode "evaluated", the stage-resolved value per frame - so a driven fade is drawn and heard in the editor exactly as the farm's mix folds it.
Worked example: Fade the bus down
The scene. A Mix comp holding one precomp layer, Bus, that plays a small Bed comp carrying a soft test tone - a bus whose audio level the farm's mix applies as gain over everything beneath it.
- The comp Mix: 640 by 360 at 25 fps, 100 frames (4 seconds).
- The comp Bed: 320 by 180 at 25 fps, 100 frames (4 seconds).
- Bed face in Bed: a solid layer, at [160, 90], 120 by 60, filled 4d9de0.
- Bus in Mix: a precomp layer playing Bed, at [320, 180].
- Bed tone in Bed: an audio layer playing the staged
tone440tone (no pixels - the farm mixes it).
The script. Add a project script named Fade down and paste:
export const outputs = ["layer_2:audio.level"];
export function frame() {
return linear(time, 0, 2, 0, -30);
}
Line by line:
- Line 1: One output: the Bus layer's AUDIO LEVEL. A precomp is a bus - its level is a further gain over every audio source inside it - and one of the hosts the key is legal on (a plain solid or text layer has no audio.level, and a script naming one refuses with reference_missing).
- Line 4: linear() maps the first two seconds onto 0 to -30 decibels and holds -30 after that: a two second fade down, returned straight into the level. The value must stay inside the -96..+12 rails - a script that returns +40 refuses with type_mismatch, never a clamp.
What you see. The bus fades from unity to -30 decibels across the first two seconds and holds there - the Bed tone underneath audibly falls away in the rendered mix, in the editor the bus's waveform lane draws the fade and the preview audio plays it (the evaluated read), and the Audio level row keeps its authored 0 dB with the script marker.