Audio
A sound that plays during playback. It has no picture; its position only matters for stereo Auto. Call its play, pause and stop from formulas and events.
In a formula, a node is called by its name in the layers panel: Audio1.src
Properties
srcLibraryFile#
The audio file from the project library that this node plays. Empty means nothing to play.
Default '' · animatable
volumeNumber#
Loudness as a multiple of the file. 1 is the original level, 0 is silent, 2 is double. Values outside 0 to 2 are clamped.
Default 1 · 0 – 2 · animatable
panNumber#
Stereo position from -1 (left speaker) to 1 (right speaker). 0 is the centre.
While spatial is on, the node sets the pan itself from where it sits in the view (the active camera, or the editor view), and writes to pan have no effect on what you hear.
Default 0 · -1 – 1 · animatable
playbackRateNumber#
Playback speed as a multiple of normal. 2 plays twice as fast and one octave higher. Range 0.1 to 4.
Default 1 · 0.1 – 4 · animatable
loopBoolean#
Plays the sound again from the start each time it ends. Fade out does not apply to a looping sound.
Default false · animatable
autoplayBoolean#
Plays the sound once when playback of the document starts.
Default false · animatable
maxInstancesNumber#
How many copies of the sound may play at once. Starting one more stops the oldest. 0 means no limit.
Default 0 · 0 – 128 · animatable
spatialBoolean#
When on, the stereo position follows where the node sits across the view: far left pans left, far right pans right, the centre stays centred.
Default false · animatable
fadeInNumber#
Seconds the volume takes to rise from silence to full when the sound starts. 0 means no fade.
Default 0 · 0 – 30 · animatable
fadeInCurveString#
Easing of the fade in, by name (for example 'linear') or as a cubic-bezier().
Default 'linear' · animatable
fadeOutNumber#
Seconds before the end of the sound over which the volume falls to silence. 0 means no fade. Ignored while loop is on.
Default 0 · 0 – 30 · animatable
fadeOutCurveString#
Easing of the fade out, by name (for example 'linear') or as a cubic-bezier().
Default 'linear' · animatable
startOffsetNumber#
Position in the file, in seconds, where playback begins. 0 is the start of the file.
Default 0 · 0 – ∞ · animatable
endOffsetNumber#
Position in the file, in seconds, where playback stops. 0 plays to the end of the file.
Default 0 · 0 – ∞ · animatable
Methods
play() → AudioInstance | nullmethod#
Starts the sound with the node's current volume, pan, speed, loop and fades. Each call starts another copy that plays alongside the others; past maxInstances the oldest one stops. Returns nothing when no file is set.
stop()method#
Stops every copy of the sound that is playing.
pause()method#
Pauses every copy of the sound where it is.
resume()method#
Continues every paused copy from where it paused.
Transform from Transform
xNumber#
Horizontal position of the node's origin, in pixels from its parent's origin.
The origin is the point the node turns and scales around (the small circle you can drag on the canvas). Setting x moves the whole node so that its origin lands there.
pixels · animatable
yNumber#
Vertical position of the node's origin, in pixels from its parent's origin. Larger values are lower.
pixels · animatable
wNumber#
Width of the node in pixels.
On a skewed node this is the width you see on screen, not the width of the box before the skew.
0 – ∞ · pixels · animatable
rotationNumber#
How far the node is turned around its origin, in degrees. Positive values turn it clockwise.
degrees · animatable
skewNumber#
How far the node is slanted along its own horizontal axis, in degrees.
Accepted values are -89 to 89, and 0 means no slant. The node stays anchored at its origin. A skewed node reports a wider w, because w is the width you see on screen. Bones and skeletons ignore skew.
degrees
Appearance from Appearance
opacityNumber#
How opaque the node is, from 0 (invisible) to 1 (solid).
It applies to the node and everything inside it. It multiplies with the opacity of each paint.
Default 1 · 0 – 1 · animatable
blendModeBlendMode#
How the node mixes its colours with what is behind it, for example MULTIPLY or SCREEN.
NORMAL just draws over the background. The other values are NORMAL, PASS_THROUGH, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, HUE, SATURATION, COLOR and LUMINOSITY.
Default 'NORMAL' · animatable
visibleBoolean#
Whether the node is drawn. Set it to false to hide the node and everything inside it.
A hidden node still exists, so formulas can read and change its properties.
Default true · animatable
Node methods every node has them
is(typeOrTag: String) → Booleanmethod#
True when the node is of this type or carries this tag.
typeOrTagA node type such as 'RECT', or a tag.
clone() → Nodemethod#
Makes a copy of the node and returns it, so code can place and change the copy.
destroy()method#
Marks the node for removal; it is taken out of the scene at the end of the frame.
appendChild(child: Node) → Nodemethod#
Moves child into this node as its last child and returns it.
insertBefore(newChild: Node, refChild: Node | null) → Nodemethod#
Moves newChild into this node, just before refChild, and returns it.
refChildThe child to insert before; null appends at the end.
removeChild(child: Node) → Nodemethod#
Takes child out of this node and returns it.
replaceChildren(...nodes: Node)method#
Replaces all of this node's children with the given nodes, in that order.
insertAdjacentElement(position: 'afterbegin' | 'beforeend', element: Node) → Node | nullmethod#
Moves element into this node, as its first or last child.
position'afterbegin' puts it first, 'beforeend' last. Any other position does nothing and returns null.
on(event: String, fn: Function)method#
Calls fn each time fire(event) is called on this node. These are the node's own messages, not the Events panel: a click does not reach on('click').
off(event: String, fn: Function)method#
Stops calling fn for event.
fnThe same function that was passed to on.
fire(event: String, ...args: any)method#
Calls every function added with on(event) on this node, in the order they were added.
...argsPassed on to every listener.