%% Connect Input to MIDI Device
% Query your system for MIDI devices.

mididevinfo

% Create a MIDI device object to interface with your selected input device. As soon as you create the MIDI device object, it begins listening for MIDI messages and storing them in a buffer.

device = mididevice('Input','USB MIDI Interface ');

% Copyright 2012 The MathWorks, Inc.