# Need answers/direction - Midi processing

**URL:** <https://forum.juce.com/t/need-answers-direction-midi-processing/13478>\
**Category:** JUCE Jobs\
**Created:** [September 2, 2014, 2:45am UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478 "2014-09-02T02:45:39Z")\
**Posts on this page:** 7\
**Page:** 1

<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, 2:45am UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/1 "2014-09-02T02:45:39Z")

</div>

I'm trying to pull off something with Midi files and don't understand how. Just really need to know how to go about it, willing to paypal someone for some direction/answers... If in fact JUCE can play midi files/tracks. I don't so much need code as direction.

---

<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:** [September 2, 2014, 7:46am UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/2 "2014-09-02T07:46:18Z")

</div>

There's nothing to just "play a whole midi file".

Everything is juce is block-based because that's how most serious audio work is done - if you have an audio callback you can send small blocks of midi to the output devices, but generally in a serious app you wouldn't want a function that just dumps a whole midi file to the output because you probably need more control over stopping/starting playback.

---

<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, 4:38pm UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/3 "2014-09-02T16:38:20Z")

</div>

I do want to play a midi file, and have a piano roll that shows the&nbsp;notes moving along (not all of them, just the upcoming ones). How do I generally structure a juce app to do this?&nbsp;

---

<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:** [September 2, 2014, 4:44pm UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/4 "2014-09-02T16:44:48Z")

</div>

Impossible to give a useful answer to such a broad question!

You'd probably want to use a high-res timer to actually play the notes - that's what we do in things like tracktion. But you'd need to build a model of what you're playing, create transport controls for it, a UI etc.

---

<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, 6:07pm UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/5 "2014-09-02T18:07:00Z")

</div>

I don't want to determine when to play the notes, I want "JUCE" (synthesiser? to play them)&nbsp;  
  
It is more than one question, though:  
  
1) How is a midi file played in JUCE?&nbsp;  
2) How do I determine the current time position (being played)  
3) How to use current time to obtain relevant notes for graphing?&nbsp;  
  
I expect the first two are trivial questions, the last one being more interesting.

---

<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:** [September 6, 2014, 8:14am UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/6 "2014-09-06T08:14:21Z")

</div>

There are classes to control a midi i/o devices, to parse midi files and let&nbsp;you iterate the events in them,&nbsp;to create synthesisers, to use high res timers for sending notes at a precise time&nbsp;etc etc. It's up to you to tie all those parts together to play the file in whatever way is appropriate for your app. If you're looking for a magic function called "playMidiFile" then you're going to be disappointed.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [February 1, 2021, 9:39am UTC](https://forum.juce.com/t/need-answers-direction-midi-processing/13478/7 "2021-02-01T09:39:19Z")

</div>


