Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
TheMidi
API provides the ability to connect Interface with musical instruments and other external or virtual
devices via the MIDI protocol. For further information and examples, see the tutorial:
Use MIDI to Control Your Environment.
Note: Only works on Windows.
Methods
Name | Return Value | Summary |
---|---|---|
allNotesOff
|
None |
Turns off all notes on all connected MIDI devices. |
blockMidiDevice
|
None |
Blocks a MIDI device's input or output. |
broadcastEnable
|
None |
Enables or disables broadcasts to all unblocked devices. |
listMidiDevices
|
Array.<string> |
Gets a list of MIDI input or output devices. |
playMidiNote
|
None |
Plays a note on all connected devices. |
resetDevices
|
None |
Cleans up and rediscovers attached MIDI devices. |
sendMidiMessage
|
None |
Sends a MIDI message to a particular device. |
sendRawDword
|
None |
Sends a raw MIDI packet to a particular device. |
thruModeEnable
|
None |
Enables or disables repeating all incoming notes to all outputs. (Default is disabled.) |
typeChanPressureEnable
|
None |
Enables or disables channel pressure events. |
typeControlChangeEnable
|
None |
Enables or disables control change events. |
typeNoteOffEnable
|
None |
Enables or disables note off events. |
typeNoteOnEnable
|
None |
Enables or disables note on events. |
typePitchBendEnable
|
None |
Enables or disables pitch bend events. |
typePolyKeyPressureEnable
|
None |
Enables or disables poly key pressure events. |
typeProgramChangeEnable
|
None |
Enables or disables program change events. |
typeSystemMessageEnable
|
None |
Enables or disables system message events. |
unblockMidiDevice
|
None |
Unblocks a MIDI device's input or output. |
Signals
Name | Summary |
---|---|
midiMessage
|
Triggered when a connected device sends an output. |
midiNote
|
Triggered when a connected device sends an output. Deprecated: This signal is deprecated and will be removed. Use midiMessage instead. |
midiReset
|
Triggered when the system detects there was a reset such as when a device is plugged in or unplugged. |
Type Definitions
MidiMessage Type: object |
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A MIDI message. Warning: The Properties
|
MidiStatus Type: number |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A MIDI status value. The following MIDI status values are supported:
|
RawMidiMessage Type: number |
|||||
---|---|---|---|---|---|
An integer DWORD (unsigned 32 bit) message with bits having values as follows:
Where:
The number in the first bit of each byte denotes whether it is a command (1) or data (0). |
Method Details
(static) allNotesOff( ) |
---|
Turns off all notes on all connected MIDI devices. |
(static) blockMidiDevice( name, output ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Blocks a MIDI device's input or output. Parameters
|
(static) broadcastEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables broadcasts to all unblocked devices. Parameters
|
(static) listMidiDevices( output ) → {Array.<string>}
Returns: Array.<string> |
||||||
---|---|---|---|---|---|---|
Gets a list of MIDI input or output devices. Parameters
|
(static) playMidiNote( status, note, velocity ) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Plays a note on all connected devices. Parameters
|
(static) resetDevices( ) |
---|
Cleans up and rediscovers attached MIDI devices. |
(static) sendMidiMessage( device, channel, type, note, velocity ) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sends a MIDI message to a particular device. Parameters
|
(static) sendRawDword( device, raw ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sends a raw MIDI packet to a particular device. Parameters
|
(static) thruModeEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables repeating all incoming notes to all outputs. (Default is disabled.) Parameters
|
(static) typeChanPressureEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables channel pressure events. Parameters
|
(static) typeControlChangeEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables control change events. Parameters
|
(static) typeNoteOffEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables note off events. Parameters
|
(static) typeNoteOnEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables note on events. Parameters
|
(static) typePitchBendEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables pitch bend events. Parameters
|
(static) typePolyKeyPressureEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables poly key pressure events. Parameters
|
(static) typeProgramChangeEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables program change events. Parameters
|
(static) typeSystemMessageEnable( enable ) | ||||||
---|---|---|---|---|---|---|
Enables or disables system message events. Parameters
|
(static) unblockMidiDevice( name-, output ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Unblocks a MIDI device's input or output. Parameters
|
Signal Details
midiMessage(
message
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a connected device sends an output. Parameters
|
midiNote(
message
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a connected device sends an output. Deprecated: This signal is deprecated and will be removed. Use midiMessage instead. Parameters
|
midiReset(
)
Returns: Signal |
---|
Triggered when the system detects there was a reset such as when a device is plugged in or unplugged. |