Dimension-Mapping Controller
Description
Create a (one- or multi-dimensional) controller by mapping dimensions to it from the dimensions of other controller(s)
(make-controller 'dimension-mapping ... )
Lisp Syntax and Default Values
The 'dimension-mapping controller can be created using the following Lisp syntax:
(make-controller 'dimension-mapping dimension
(list (list controller1 index1 dim11 dim12 ...)
(list controller2 index2 dim21 dim22 ...)
... ))
Parameters
The 'dimension-mapping controller takes the following arguments:
- dimension: number of dimensions of the output controller.
- controllerN: input controller N.
- indexI: index I on input controller N.
- dimIJ: series of dimension(s) J on which controllerN[indexI] will be mapped.
This function takes a list of mapping lists lists as its final argument. The number of mapping lists lists depends on the number of output (and input) controllers.
Discussion
The dimension-mapping controller accepts a list of dimension mapping lists, each of them containing an input controller (of arbitrary dimension), a dimension index on the input controller and a set of mapped output dimensions. The indexed entry of the input controller will be then assigned to each of the specified dimensions of the dimension-mapping controller.
The following is a practical example that uses the dimension-mapping controller to map the 2 channels of a stereo sound file into two separate Modalys controllers:
(setq sf-ctl (make-controller 'sound-file 2 0 (const 44100) "my-sf.aiff" 0 my-sf-length 30 ))
(setq ch1-ctl (make-controller 'dimension-mapping 1 (list (list sf-ctl 0 0))))
(setq ch2-ctl (make-controller 'dimension-mapping 1 (list (list sf-ctl 1 0))))
(setq sf-ctl (make-controller 'sound-file 2 0 (const 44100) "my-sf.aiff" 0 my-sf-length 30 ))
(setq swap-ctl (make-controller 'dimension-mapping 2
(list (list sf-ctl 0 1)
(list sf-ctl 1 0))))
(setq sf-ctl1 (make-controller 'sound-file 1 0 (const 44100) "my-sf1.aiff" 0 my-sf-length 30 ))
(setq sf-ctl2 (make-controller 'sound-file 1 0 (const 44100) "my-sf2.aiff" 0 my-sf-length 30 ))
(setq 2d-ctl (make-controller 'dimension-mapping 2
(list (list sf-ctl1 0 0)
(list sf-ctl2 0 1))))
(setq sf-ctl (make-controller 'sound-file 1 0 (const 44100) "my-sf.aiff" 0 my-sf-length 30 ))
(setq 4d-ctl (make-controller 'dimension-mapping 4 (list (list sf-ctl 0 0 1 2 3))))