Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

midicallback

Call function handle when MIDI controls change value

The midicallback function will be removed from DSP System Toolbox™ in a future release. Existing instances of the function continue to run. For new code, use the midicallback function from Audio System Toolbox™ instead.

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

collapse all

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

collapse all

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

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

collapse all

The function handle set by the previous call to midicallback.

Example: @myFunction

The function handle set by the current call to midicallback.

Example: @myFunction

Introduced in R2013b

Was this topic helpful?