Skip to content

Delay Controller

Description

A controller whose output is that of an input controller delayed in time.

(make-controller 'delay ... )

Lisp Syntax and Default Values

The 'delay controller can be created using the following Lisp syntax:

(make-controller 'delay dimension delaytime controller)

Parameters

The 'delay controller takes three arguments:

  • dimension: number of dimensions of the input and output controllers.
  • delaytime: a controller (or numerical value) expressing the delay time in seconds.
  • controller: controller to be delayed.

The number of dimensions should be the same as that of the input controller.

The delay time can be either a constant or dynamic controller, or else be given as a numerical value.

Discussion

The following shows a very simple example of using the delay controller to delay a simple envelope by half a second (as shown in the graph, at the top of this page):

(setq my-env (make-controller 'envelope 1 '((0 0.0) (0.2 1.0) (0.4 0)) ))
(setq my-delay (make-controller 'delay 1 0.5 my-env))
As you can see, this controller allows another controller to be delayed by a given (optionally dynamically variable) delay time. It does not alter that controller, but rather creates a new controller. This can be useful for many operations, such as delaying a force controller used for sympathetic resonance. The following example show precisely that, with a 1/4 second delay applied to the force controller:

(setq speed-ctl (make-controller 'access-speed 1 my-string-plk))
(setq delay-ctl (make-controller 'delay 1 (const 0.25) speed-ctl))
(make-connection 'force my-plate-hit delay-ctl)