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
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.
msg = midimsg('NoteOn',channel,note,velocity,timestamp)NoteOn
                    midimsg, with specified Channel,
                        Note, Velocity, and
                        Timestamp properties.
msg = midimsg('NoteOff',channel,note,velocity,timestamp)NoteOff
                    midimsg, with specified Channel,
                        Note, Velocity, and
                        Timestamp properties.
msg = midimsg('ControlChange',channel,ccnumber,ccvalue,timestamp)ControlChange
                    midimsg, with specified Channel,
                        CCNumber, CCValue, and
                        Timestamp properties.
msg = midimsg('ProgramChange',channel,program,timestamp)ProgramChange
                    midimsg, with specified Channel,
                        Program, and Timestamp
                    properties.
msg = midimsg('SystemExclusive',bytes,timestamp)SystemExclusive message sequence, with
                    specified Timestamp property.
msg = midimsg('SystemExclusive',timestamp)SystemExclusive
                    midimsg, with specified Timestamp
                    property.
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].
msg = midimsg('EOX',timestamp)EOX
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('TimingClock',timestamp)TimingClock
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('Start',timestamp)Start
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('Continue',timestamp)Continue
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('Stop',timestamp)Stop
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('ActiveSensing',timestamp)ActiveSensing
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('SystemReset',timestamp)SystemReset
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('TuneRequest',timestamp)TuneRequest
                    midimsg, with specified Timestamp
                    property.
msg = midimsg('MIDITimeCodeQuarterFrame',seq,value,timestamp)MIDITimeCodeQuarterFrame
                    midimsg, with specified TimeCodeSequence,
                        TimeCodeValue, and Timestamp
                    properties.
msg = midimsg('SongPositionPointer',position,timestamp)SongPositionPointer
                    midimsg, with specified SongPosition and
                        Timestamp properties.
msg = midimsg('SongSelect',song,timestamp)SongSelect
                    midimsg, with specified Song and
                        Timestamp properties.
msg = midimsg('AllSoundOff',channel,timestamp)AllSoundOff
                    midimsg, with specified Channel and
                        Timestamp properties.
msg = midimsg('ResetAllControllers',channel,timestamp)ResetAllControllers
                    midimsg, with specified Channel and
                        Timestamp properties.
msg = midimsg('LocalControl',channel,localcontrol,timestamp)LocalControl
                    midimsg, with specified Channel,
                        LocalControl, and Timestamp
                    properties.
msg = midimsg('PolyOn',channel,timestamp)PolyOn
                    midimsg, with specified Channel and
                        Timestamp properties.
msg = midimsg('MonoOn',channel,monoChannels,timestamp)MonoOn
                    midimsg, with specified Channel,
                        MonoChannels, and Timestamp
                    properties.
msg = midimsg('OmniOn',channel,timestamp)OmniOn
                    midimsg, with specified Channel and
                        Timestamp properties.
msg = midimsg('OmniOff',channel,timestamp)OmniOff
                    midimsg, with specified Channel and
                        Timestamp properties.
msg = midimsg('AllNotesOff',channel,timestamp)AllNotesOff
                    midimsg, with specified Channel and
                        Timestamp properties.
msg = midimsg('PolyKeyPressure',channel,note,pressure,timestamp)PolyKeyPressure
                    midimsg, with specified Channel,
                        Note, Pressure, and
                        Timestamp properties.
msg = midimsg('ChannelPressure',channel,pressure,timestamp)ChannelPressure
                    midimsg, with specified Channel,
                        Pressure, and Timestamp
                    properties.
msg = midimsg('PitchBend',channel,change,timestamp)PitchBend
                    midimsg, with specified Channel,
                        PitchChange, and Timestamp
                    properties.
msg = midimsgmidimsg with all zero bytes. All zero bytes
                    indicates a MIDI message with Type set to
                        Data.
msg = midimsg(size)midimsg array of size with all zero
                    bytes.
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
