RedTween:
Filter:
redSys/Classes (extension) | Red > redScore

RedTween
ExtensionExtension

tweening for sclang and scserver

Description

A class for mapping values between different ranges using different curvatures. It works best in combination with the Ease quark, but is also fine to use on its own. Basically it maps a value from a certain range to another range with an optional curvature.

Class Methods

.ar

.kr

Create an UGen version.

Language side implementation

.new

Arguments:

source

The beginning.

target

The destination.

curve

The curvature.

inMin

Lowest input value.

inMax

Highest input value.

Discussion:

If the curve argument is nil then a linear mapping will be used. If it is a SimpleNumber then internally a lincurve method will be applied (so the curvature will work in the same was as for the Env class). Though the real benefit of this class is to set the curve argument to an Ease object or write a custom mapping function. This allows to do proper tweening/easing.

.value

Instance Methods

Language side implementation

.curve

Curvature if set. Else nil.

.func

Function.

.inMax

Get or set the maximum.

.inMin

Get or set the minimum.

.source

Get or set the source (start) value.

.target

Get or set the target (end) value.

.value

Perform the lookup.

Arguments:

t

A Float 0.0 to 1.0.

Examples