Controller whose output combines two or more input controllers using one of the four basic arithmetic operations (+, -, *, /). Dimension of the input controllers is limited to 1.
The 'arithmetic controller can be created using the following Lisp syntax:
(make-controller 'arithmetic dimension operator controller1 controller2 ... )
or:
(make-controller 'arithmetic dimension operator (list controller1 controller2 ... ))
The 'arithmetic controller takes the following arguments:
The number of dimensions of both input controllers and the resulting output controller must be 1.
Any number of input controllers may be provided (just as you would do for the Lisp functions +, -, * and /), but they must all be one-dimensional controllers. The controllers may be provided as a series of arguments or as a list.
Arithmetic controllers are used to realize arithmetic operations efficiently in controller networks.
A basic example shows two breakpoint envelopes being multiplied together (as shown in the image at the top of the page):
(setq my-env1 (make-controller 'envelope 1 '((0 0.0) (0.2 1.0) (0.4 0.7) (1.2 0.7) (2 0))))
(setq my-env2 (make-controller 'envelope 1 '((0 1.5) (2 0.25)) ))
(setq my-product (make-controller 'arithmetic 1 "*" my-env1 my-env2))
To provide an example, we could rewrite the fm excitation of the Modalys example 5 the following way (using Max's naming convention):
(defun +~ (ctlr0 ctlr1) (make-controller 'arithmetic 1 '+ (list ctlr0 ctlr1)))
(defun *~ (ctlr0 ctlr1) (make-controller 'arithmetic 1 '* (list ctlr0 ctlr1)))
(defun sin~ (frequency) (make-controller 'sine 1 frequency))
;;; we assume here that cf, mr, mi and ae are bound to one-dimensional controllers
(setq mrcf (*~ mr cf))
(setq fm-output (*~ (sin~ (+~ (*~ mrcf mi (sin~ mrcf)) cf)) ae))
The result is more efficient and more general code (besides we tried to make it more readable).
There are no special options for this controller.