# Play midi file

**URL:** <https://forum.juce.com/t/play-midi-file/965>\
**Category:** General JUCE discussion\
**Created:** [July 31, 2006, 3:33am UTC](https://forum.juce.com/t/play-midi-file/965 "2006-07-31T03:33:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbottoms](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rbottoms](https://forum.juce.com/u/rbottoms)\
**Post date:** [July 31, 2006, 3:33am UTC](https://forum.juce.com/t/play-midi-file/965/1 "2006-07-31T03:33:33Z")

</div>

HI, need to demo this software quickly for a client. Is there a complete turtorial for playing a MIDI file somewhere?

Thanks,  
r.b.

---

<div class="post-metadata">

**Author:** ![rbottoms](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rbottoms](https://forum.juce.com/u/rbottoms)\
**Post date:** [July 31, 2006, 8:25am UTC](https://forum.juce.com/t/play-midi-file/965/2 "2006-07-31T08:25:10Z")

</div>

BTW, I got the demo package to work, but a stand-alone MIDI demo would still be very helpful.

r.b.

---

<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:** [July 31, 2006, 9:21am UTC](https://forum.juce.com/t/play-midi-file/965/3 "2006-07-31T09:21:17Z")

</div>

Yes, there’s no support at the moment for actually running a thread to send the notes to a midi output at the correct time. There’s plenty of stuff to parse the file and send events to midi devices though. You basically need to use a MidiFile object to load the data, then you can get each of its tracks as a MidiMessageSequence. What you’d need to do is to write a thread that calls MidiOutput::sendMessageNow to send each event at the correct time.

---

<div class="post-metadata">

**Author:** ![\_pi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/_pi/32/527_2.png) [@\_pi](https://forum.juce.com/u/_pi)\
**Post date:** [August 19, 2014, 8:56pm UTC](https://forum.juce.com/t/play-midi-file/965/4 "2014-08-19T20:56:14Z")

</div>

Aug 2014 now...

Can anyone recommend a third party library for doing this?&nbsp; I wrote a MIDI player last year in C#, so rolling my own would be a close second choice.

π

---

<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:** [August 20, 2014, 8:43am UTC](https://forum.juce.com/t/play-midi-file/965/5 "2014-08-20T08:43:12Z")

</div>

This thread is&nbsp;from 2006, the info in here is completely out-of-date!

I added a method MidiOutput::sendBlockOfMessages years ago, which might help with whatever you're trying to do.

---

<div class="post-metadata">

**Author:** ![joelt](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@joelt](https://forum.juce.com/u/joelt)\
**Post date:** [September 2, 2014, 1:30am UTC](https://forum.juce.com/t/play-midi-file/965/6 "2014-09-02T01:30:31Z")

</div>

The question from 2006 ...&nbsp;"Is there a complete turtorial for playing a MIDI file somewhere?"

I don't see one. I would really like to see one.

---

<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:01am UTC](https://forum.juce.com/t/play-midi-file/965/7 "2017-05-12T10:01:14Z")

</div>


