: oldhandle = midicallback (midicontrolsObj, functionHandle)
: oldhandle = midicallback (midicontrolsObj, [])
: currhandle = midicallback (midicontrolsObj)

Get, set or clear the midicontrol object callback.

Inputs

midicontrolObj - control object created using midicontrols.

functionHandle - function handle to set for call back. If it is [], the callback function will be cleared.

NOTE: currently anonymous functions will not work.

NOTE: callbacks should be cleared before losing all references to the midicontrols object.

Outputs

oldhandle The previously set midicallback function handle when setting a new callback.

currhandle The current set midicallback function handle.

Examples

Set a callback on a midicontrols object

ctrl = midicontrols(2001)
function dispCallback(ctrl),disp(midiread(ctrl)),endfunction;
midicallback(ctrl, @dispCallback);

Clear the callback on a midicontrols object

ctrl = midicontrols(2001)
midicallback(ctrl, []);

Get the current callback on a midicontrols object

ctrl = midicontrols(2001)
cb = midicallback(ctrl);

See also: midicontrols, midisync, midiread.

Package: audio