# MIDI SysEx messages... Is it correct?

**URL:** <https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373>\
**Category:** General JUCE discussion\
**Created:** [December 3, 2007, 4:09am UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373 "2007-12-03T04:09:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![br-programmer](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@br-programmer](https://forum.juce.com/u/br-programmer)\
**Post date:** [December 3, 2007, 4:09am UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373/1 "2007-12-03T04:09:45Z")

</div>

Hello, people,

I’m trying to send a MIDI tuning SysEx message and I’m getting an access violation in juce\_Win32\_midi.cpp at line 617. My code looks like this:

```auto
uint8 midiNote = 69;
const uint8 rawSysEx[10] = {0x7F, 0x7F, 0x08, 0x02, 0x00, 0x01, midiNote, midiNote, 0x00, 0x00};
MidiMessage mySysEx = MidiMessage::createSysExMessage(rawSysEx,10);
midiOutput->sendMessageNow(mySysEx);
```

What could be wrong? I’m trying to send a test MIDI tuning change message for a single key, according to the site [http://www.midi.org/about-midi/tuning.shtml](http://www.midi.org/about-midi/tuning.shtml)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 3, 2007, 1:30pm UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373/2 "2007-12-03T13:30:16Z")

</div>

Looks fine to me - can you find out more about exactly what’s crashing? Does the data look ok just before it calls midiOutLongMsg()?

---

<div class="post-metadata">

**Author:** ![br-programmer](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@br-programmer](https://forum.juce.com/u/br-programmer)\
**Post date:** [December 7, 2007, 3:53am UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373/3 "2007-12-07T03:53:51Z")

</div>

I think I have found the problem. I was sending (after the sysex message) another midi message to the channel zero (invalid channel). This may have caused a crash. I had to clean/rebuild the application and change from zero to channel one to make it work.

---

<div class="post-metadata">

**Author:** ![br-programmer](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@br-programmer](https://forum.juce.com/u/br-programmer)\
**Post date:** [December 7, 2007, 10:52pm UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373/4 "2007-12-07T22:52:43Z")

</div>

No, the problem did not stop yet. Sometimes when I start debugging, my app breaks on the following line:

```auto
void MidiOutput::sendMessageNow (const MidiMessage& message)
{
    const MidiOutHandle* const handle = (const MidiOutHandle*) internal;
```

What does this line mean?

Thanks!

---

<div class="post-metadata">

**Author:** ![br-programmer](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@br-programmer](https://forum.juce.com/u/br-programmer)\
**Post date:** [December 8, 2007, 12:13pm UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373/5 "2007-12-08T12:13:34Z")

</div>

This text may give some answers:  
[Managing MIDI Ports](http://www.borg.com/~jglatt/tech/share.htm)

I prevented the app to start the MidiOut automatically, so the user must explicitly click a button to start MidiOut. Now, apparently that bug was solved.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 12, 2017, 10:05am UTC](https://forum.juce.com/t/midi-sysex-messages-is-it-correct/2373/6 "2017-05-12T10:05:35Z")

</div>

Closed on May 12, 2017, 10:05am UTC


