function [Pattern]

Implements user defined pattern description by calling a function each time a new period of items is needed.

function implements the following option value pairs:

with {function}
Sets the function for the pattern. The function may take any number of arguments and should returns two values: the list of items constituting the next period, and an optional list of states corresponding to each item returned. It is an error to return no items.
args {arglist}
Sets the arguments to pass to the function. Defaults to nil.

Example:

? (let ((n 60))
    (setf x (notes in function with #'(lambda () (incf n)))))
#<FUNCTIONAL-NOTE-STREAM 132004641>

? (read-items x 10)
(CS4 D4 DS4 E4 F4 FS4 G4 GS4 A4 AS4)

See Also:

Item Streams


Last Modified: 5-Mar-1998