Parameter Curves
Media parameters are able to follow a curve over time. Each curve is described by a mathematical formula and two end-points. Each end-point is defined by a reference time and the value of the curve at that time. The formula is used to calculate intermediate values between the points, and determines the shape of the curve. The possible curves are:
- Jump
- Linear
- Square
- Inverse square
- Sine
"Jump" means jump directly to the end value. The other curves are shown in the following diagram.
Mathematically, the curves work as follows. Suppose that a curve begins at time t₀ with a value of v₀, and ends at time t₁ with a value of v₁. The two points that define the curve are (t₀, v₀) and (t₁, v₁).
- Let Δt be the total duration of the curve, t₁–t₀.
- Let Δv be the interval between the starting and ending values, v₁–v₀.
- At any time t such that t₀ <= t <= t₁, let Δt' = t–t₀.
The value of the parameter at time t is:
v = f( Δt' / Δt ) * Δv + v₀
where f(x) is a function determined by the curve type:
- Linear: y = x
- Square: y = x^2
- Inverse square: y = sqrt(x)
- Sine: y = [ sin(πx – π/2) + 1 ] / 2
Observe that Δt' < Δt, so the term Δt'/Δt ranges from 0 to 1. Therefore, f(x) also ranges from 0 to 1, and v always falls between v₀ and v₁. This is true whether v₀ < v₁ or vice versa. In other words, the curve is bounded by the rectangle (t₀, v₀, t₁, v₁).
For the sine curve, the value of (πx – π/2) ranges from –π/2 to π/2, which means that sin(πx – π/2) ranges from –1 to 1. The result is then normalized so that f(x) falls into the range (0–1).
Related topics