Documentation Center

  • Trial Software
  • Product Updates

midicallback

Call function handle when MIDI controls change value

Syntax

  • oldfh = midicallback(h,newfh) example
  • oldfh = midicallback(h,[])
  • fh= midicallback(h)

Description

example

oldfh = midicallback(h,newfh) sets newfh as the function handle to be called when h changes value, and returns the previous function handle, oldfh.

oldfh = midicallback(h,[]) clears the function handle.

fh= midicallback(h) returns the current function handle.

Examples

expand all

Interactively Read MIDI Controls

Use the midicallback command with an anonymous function to interactively read MIDI controls.

h = midicontrols; 
midicallback(h,@(h)disp(midiread(h)));
% Now move any control on the default MIDI device.
   0.6587
   0.6429
   0.6349
   0.6270
   0.6190
   0.6111
   0.6032
   0.5952
clear h

Input Arguments

expand all

h — Object that listens to the controls on a MIDI device object

h is an object that listens to the controls on a MIDI device.

newfh — new function handlefunction handle

The new function handle, which is set as the function handle to be called when h changes value. For information on what function handles are, see Function Handles.

Example: @myFunction

Output Arguments

expand all

oldfh — Old function handlefunction handle

The function handle set by the previous call to midicallback.

Example: @myFunction

fh — Current function handlefunction handle

The function handle set by the current call to midicallback.

Example: @myFunction

See Also

| | | |

Was this topic helpful?