Code covered by the BSD License  

Highlights from
MIDI Interface for MATLAB

5.0

5.0 | 1 rating Rate this file 32 Downloads (last 30 days) File Size: 16.9 KB File ID: #37769
image thumbnail

MIDI Interface for MATLAB

by

 

04 Sep 2012 (Updated )

Supports bringing incoming MIDI data into MATLAB on Windows.

| Watch this File

File Information
Description

This simple interface allows MATLAB to read incoming MIDI data from a MIDI device or another MIDI program. For instance, if a MIDI keyboard is connected to the computer running MATLAB, this interface could be used to see what keys the user is playing, what knobs he's twisting, what pedals he has down, etc.

% Open an interface; the tool will prompt to select a device.
midi_interface('open');

% Play some notes on a connected keyboard or wiggle some knobs on a MIDI controller.

% Read all the new MIDI messages.
messages = midi_interface();

% Close the device.
midi_interface('close');

This currently only works on Windows (32/64-bit) and only supports one MIDI device at a time. If this tool proves useful for people, we could take it further, so just let me know!

Early beta.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Other requirements Windows XP, Vista, 7, or 8.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
29 Sep 2014 Dace

Sorry, had a problem with the cable. Now working. Great code, very helpful. Thanks!

24 Sep 2014 Dace

I wonder, why do I always get an empty messages matrix?

I open the interface, select the device, play some notes on the keyboard and execute messages = midi_interface() which always returns an empty matrix.

28 Jan 2014 Katarzyna Zarnowiec

very helpful! thank you!

Updates
25 Jul 2013

Updated copyright information.

25 Jul 2013

The output timestamps of the MIDI data were wrong and aren't any more. (Thanks Janne.)

Contact us