PortMidi.SendSysExHex
---------------------

Writes a timestamped system-exclusive midi message.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PortMidi](component_PortMidi.md) | [4.2](newinversion42.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "PortMidi.SendSysExHex"; StreamRef; Message { ; TimeStamp } ) 

**MBS**( **"PortMidi.SendSysExHex";** /\* Writes a timestamped system-exclusive midi message. \*/  
**$StreamRef**; /\* The reference to the midi stream. You create those with [PortMidi.OpenInput](PortMidiOpenInput.md) or [PortMidi.OpenOutput](PortMidiOpenOutput.md) and finally close them with [PortMidi.Close](PortMidiClose.md).e.g. $stream \*/   
**$Message**; /\* The message to send. \*/   
**$TimeStamp**) /\* Optional; The timestamp.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| StreamRef | The reference to the midi stream. You create those with [PortMidi.OpenInput](PortMidiOpenInput.md) or [PortMidi.OpenOutput](PortMidiOpenOutput.md) and finally close them with [PortMidi.Close](PortMidiClose.md). | $stream |  |
| Message | The message to send. |  |  |
| TimeStamp | The timestamp. | 0 | Optional |

### Result

Returns OK or error.

### Description

Writes a timestamped system-exclusive midi message.  
The input text must be hex encoded and is decoded before sending.  
### Examples

Send SysEx:

 MBS ( "PortMidi.SendSysExHex"; $out ; "F000200D681020002BF7" )  
### See also

- [PortMidi.Close](PortMidiClose.md)
- [PortMidi.OpenInput](PortMidiOpenInput.md)
- [PortMidi.OpenOutput](PortMidiOpenOutput.md)

This function is free to use.

Created 18th August 2014 , last changed 11st December 2017

  
[PortMidi.SendMessageRaw](PortMidiSendMessageRaw.md) - [PortMidi.SetChannelMask](PortMidiSetChannelMask.md)

[HTML Version](PortMidiSendSysExHex.shtml)