midimsg
Create MIDI message
Description
Create a MIDI message in MATLAB® using midimsg. Create a MIDI device interface using mididevice.
Send and receive messages using midisend
and midireceive. When you create a MIDI message, you specify it as a MIDI
message type.

For a tutorial on MIDI messages and interfacing with MIDI devices, see MIDI Device Interface.
Creation
Syntax
Description
returns two MIDI messages: msg = midimsg('Note',channel,note,velocity,duration,timestamp)NoteOn and
NoteOff, with specified Channel,
Note, Velocity, and
Timestamp properties. The
Timestamp property of the NoteOff
message is determined as the Timestamp property of the
NoteOn message plus the
duration.
returns a msg = midimsg('NoteOn',channel,note,velocity,timestamp)NoteOn
midimsg, with specified Channel,
Note, Velocity, and
Timestamp properties.
returns a msg = midimsg('NoteOff',channel,note,velocity,timestamp)NoteOff
midimsg, with specified Channel,
Note, Velocity, and
Timestamp properties.
returns a msg = midimsg('ControlChange',channel,ccnumber,ccvalue,timestamp)ControlChange
midimsg, with specified Channel,
CCNumber, CCValue, and
Timestamp properties.
returns a msg = midimsg('ProgramChange',channel,program,timestamp)ProgramChange
midimsg, with specified Channel,
Program, and Timestamp
properties.
returns a complete msg = midimsg('SystemExclusive',bytes,timestamp)SystemExclusive message sequence, with
specified Timestamp property.
returns a msg = midimsg('SystemExclusive',timestamp)SystemExclusive
midimsg, with specified Timestamp
property.
returns a msg = midimsg('Data',bytes,timestamp)Data
midimsg for use in a System Exclusive message, with specified
MsgBytes and Timestamp properties.
bytes is specified as a scalar, vector, or
multi-dimensional array of elements. Each element of bytes
must be in the range [0,127].
returns an msg = midimsg('EOX',timestamp)EOX
midimsg, with specified Timestamp
property.
returns a msg = midimsg('TimingClock',timestamp)TimingClock
midimsg, with specified Timestamp
property.
returns a msg = midimsg('Start',timestamp)Start
midimsg, with specified Timestamp
property.
returns a msg = midimsg('Continue',timestamp)Continue
midimsg, with specified Timestamp
property.
returns a msg = midimsg('Stop',timestamp)Stop
midimsg, with specified Timestamp
property.
returns a msg = midimsg('ActiveSensing',timestamp)ActiveSensing
midimsg, with specified Timestamp
property.
returns a msg = midimsg('SystemReset',timestamp)SystemReset
midimsg, with specified Timestamp
property.
returns a msg = midimsg('TuneRequest',timestamp)TuneRequest
midimsg, with specified Timestamp
property.
returns a msg = midimsg('MIDITimeCodeQuarterFrame',seq,value,timestamp)MIDITimeCodeQuarterFrame
midimsg, with specified TimeCodeSequence,
TimeCodeValue, and Timestamp
properties.
returns a msg = midimsg('SongPositionPointer',position,timestamp)SongPositionPointer
midimsg, with specified SongPosition and
Timestamp properties.
returns a msg = midimsg('SongSelect',song,timestamp)SongSelect
midimsg, with specified Song and
Timestamp properties.
returns a msg = midimsg('AllSoundOff',channel,timestamp)AllSoundOff
midimsg, with specified Channel and
Timestamp properties.
returns a msg = midimsg('ResetAllControllers',channel,timestamp)ResetAllControllers
midimsg, with specified Channel and
Timestamp properties.
returns a msg = midimsg('LocalControl',channel,localcontrol,timestamp)LocalControl
midimsg, with specified Channel,
LocalControl, and Timestamp
properties.
returns a msg = midimsg('PolyOn',channel,timestamp)PolyOn
midimsg, with specified Channel and
Timestamp properties.
returns a msg = midimsg('MonoOn',channel,monoChannels,timestamp)MonoOn
midimsg, with specified Channel,
MonoChannels, and Timestamp
properties.
returns an msg = midimsg('OmniOn',channel,timestamp)OmniOn
midimsg, with specified Channel and
Timestamp properties.
returns an msg = midimsg('OmniOff',channel,timestamp)OmniOff
midimsg, with specified Channel and
Timestamp properties.
returns an msg = midimsg('AllNotesOff',channel,timestamp)AllNotesOff
midimsg, with specified Channel and
Timestamp properties.
returns a msg = midimsg('PolyKeyPressure',channel,note,pressure,timestamp)PolyKeyPressure
midimsg, with specified Channel,
Note, Pressure, and
Timestamp properties.
returns a msg = midimsg('ChannelPressure',channel,pressure,timestamp)ChannelPressure
midimsg, with specified Channel,
Pressure, and Timestamp
properties.
returns a msg = midimsg('PitchBend',channel,change,timestamp)PitchBend
midimsg, with specified Channel,
PitchChange, and Timestamp
properties.
returns a scalar msg = midimsgmidimsg with all zero bytes. All zero bytes
indicates a MIDI message with Type set to
Data.
returns a msg = midimsg(size)midimsg array of size with all zero
bytes.
returns an empty
msg = midimsg(0)midimsg.
Note
If timestamp is listed as an argument, it is optional and
defaults to zero. The exception is the
'SystemExclusive',bytes,timestamp syntax, in which case
the timestamp argument is required.
Properties
Examples
Version History
Introduced in R2018a
See Also
parameterTuner | Audio Test Bench | midisend | midireceive | mididevice
