Skip to content

Last Sample Controller

Description

A controller that always returns the last sample output by the system.

Syntax and Default Values

The 'last-sample controller can be created using the following Lisp or mlys.lua syntax:

(make-controller 'last-sample
                  dimension)
modalys.create_controller{kind="last-sample",
                          dimension=2}

Parameters

The 'last-sample controller takes just one argument:

  • dimension: number of dimensions of the controller.

The dimension for this controller must match the number of audio output audio channels. See the set-number-of-channels command in Lisp, or the modalys~ object in Max.

Discussion

This controller always returns the last sample(s) that were output by the system, using the (make-point-output ... ) function. The dimension of the controller must be the same as the number of output channels. This controller might be useful for writing a 'foreign-call controller to make decisions based on the presence of output sound, or using the output sound in a feedback loop to excite other objects. In this case the default feedback delay time would naturally be one sample, unless the controller were delayed with (make-controller 'delay ... ).

In Lisp, to use this controller, you must first define the number of output channels using the (set-number-of-channels ... ) command, even when only synthesizing the default one channel of sound.


★     ★