Class:            ExponentialFunction

Environment:      Siren
Superclass:         Siren.LinearFunction
Category:         Music-Functions
Indexed variables:   objects

Instances of ExponentialFunction are exponential-segment functions of one free variable.
They use ZPoints for x/y/exponent. The exponent determines the speed of the exponential/logarithmic transition between breakpoint values. A value of 0 leads to linear interpolation.

Example:
   ExponentialFunction from: #((0 0 -5) (0.2 1 -3) (0.8 0.5 -2) (1 0))

accessing

at: anIndex
   Answer the value at the given index in my range--do exponential interpolation such
   that if f(x, i) is the i-th function value in the transition from breakpoint v[J] to
   v[J+1], then:
      f(x) = v[J] + (v[J+1] - v[J])*(1 - exp(i*x[J]/(N-1)))/(1 - exp(x[J]))
   for 0 <= i < N, where N is the number of function points between t[J] and the next
   horizontal value, and x is the exponential weight whereby x = 0 will yield a
   straight line, x < 0 will yield an exponential transition, and x > 0 will yield a
   logarithmic transition.

pointAt: index
   Answer the given value in the receiver's breakpoint collection as a 2-D point.

printing

printOn: aStream
   Format and print the receiver on the argument.

MetaClass:         ExponentialFunction class

instance creation

a: att d: dec s: sus r: rel
   Answer an ADSR envelope.

default
   Answer a default instance of the receiver class.

from: anArrayOfPoints
   Answer a function with the given points.

examples

expADSRViewExample
   Make an exp seg and open a view on its form.

expASRViewExample
   Make an exp seg and open a view on its form.

expsegViewExample
   Make an exp seg and open a view on its form.