Skip to content

ValueChannel

Tempestissiman edited this page Jul 26, 2022 · 1 revision

Descriptions

Returns a value from timing input.

Remarks

_

Properties


Name Type Description
name string The name of the channel

Methods


find(name)

Descriptions

Find the channel within the sub-channels that composed this.

Parameters

Name Type Description
name string Name of the channel to find

Return types

ValueChannel

Remarks

Returns nil if no channel was found.

This method is useful to detect if you have previously created a channel for a property of a controller, which is a common need when working with note groups.

Example

local toFind = Channel.named("myChannel").keyframe()
local mixedChannel = Channel.noise(10, -1, 1)
track.colorA = toFind * mixedChannel

local foundChannel = track.colorA.find("myChannel")
foundChannel.addKey(0, 255)

valueAt(timing)

Descriptions

Calculate the value at a timing point.

Parameters

Name Type Description
timing number Timing point to calculate at

Return types

number

Remarks

The implementation of this method differs for each channel type.

Example

local saw = Channel.saw('so', 1000, 1, 0)
log(saw.valueAt(500))
local keyChannel = Channel.keyframe()

track.colorA.addKey(1000, keyChannel.valueAt(1000))
track.colorA.addKey(2000, 0)

Operators


Operator Return type Description
+ ValueChannel Add two value channels, or a value channel with a number, or a number with a value channel together
- ValueChannel Subtract two value channels, or a value channel with a number, or a number with a value channel together
* ValueChannel Multiply two value channels, or a value channel with a number, or a number with a value channel together
/ ValueChannel Divide one value channel with another, or a value channel with a number, or a number with a value channel

Clone this wiki locally