## A delay actor

The output of this actor is the same as its input, but delayed by a short amount of time. Optionally this output can be fed back into its input, resulting in a decaying train of echos instead of just one echo.

To use the delay actor, load delay.so and create an actor of type DelayActor.

### DelayActor messages

In addition to the messages understood by all generator actors, the DelayActor understands the following messages:

SetDelay `hActor x`
  Set the default delay for new instances created by this actor to `x` seconds.
SetAllDelay `hActor x time`
  Set the delay of all children to `x`, and set the default delay for all future children. If `time` is specified, children will modulate to the new delay over the specified duration. Default delay is always set immediately regardless of `time`.
SetFeedback `hActor x`
  Set the default amount of feedback for new instances created by this actor to `x`.
SetAllFeedback `hActor x time`
  Set the amount of feedback of all children to `x`, and set the default amount of feedback for all future children. If `time` is specified, children will modulate to the new value over the specified duration. Default amount of feedback is always set immediately regardless of `time`.

### DelayActor handler messages

In addition to the messages understood by all handlers, the handler for the DelayActor algorithm understands the following messages:

SetInput `hSound hHandler`
  Set the input to come from the handler `hHandler`.
SetDelay `hSound x time`
  Set the delay length to `x` seconds. If `time` is specified, modulate to the new value over the specified duration.
SetFeedback `hSound x time`
  Set the amount of feedback to `x`, which should be at least 0 but strictly less than 1. If `time` is specified, modulate to the new value over the specified duration.
Clear `hSound`
  Set all the samples stored the delay line to zero. (Useful if feedback is greater than zero and you want to instantly silence the train of echos.)

### Examples

`LoadDSO delay.so;
a = Create DelayActor;
`

Play a varying FM sound with a half-second echo:

  `LoadDSO fm.so; aFm = Create FmActor; sFm = BeginSound aFm;
  // SetMute sFm 1;` // Uncomment this to hear only the echo and not the original sound.`
  delay = BeginSound a SetDelay .5 SetInput sFm;
  // SetFeedback delay 0.97;` // Uncomment this to hear a train of echos.`
  SetFreq sFm 1000 2;
  sleep 3;
  SetAmp sFm 0 1;
  sleep 2;
  SetAmp sFm .4
  sleep 5;
  `