midi-receive receiver &rest args &key async? keynum duration stop-if stop-if-not initializer finalizer &allow-other-keys [API Function]

Start a MIDI recording session. receiver is a function which will be mapped over every event received. Its lambda list must be compatible with

(msg &optional time &key data length &allow-other-keys)
and will be passed each message and its millisecond time in msg and time. Sysex data and its length will be passed to fun via its data and length keywords.

When multiprocessing is supported by the Lisp implementation and async? is t, the recording loop will be executed in a separate process (this is the default, where applicable). Recording may be stopped either by a key number via keynum, a duration (in ms or s, depending on the value returned by (clock-mode)), a positive predicate in stop-if or a negative predicate in stop-if-not. keynum, duration, stop-if and stop-if-not are mutually exclusive parameters.

initializer and finalizer may be used to specify additional functions to be called immediately before or after the recording session.

Examples:

(midi-receive #'midi-print-message :keynum 24)

See Also:

midi-read-messages, *midi-read-hook*, midi-print-message

Last Modified: 12-Aug-1998