# Reading notes from midi file

**URL:** <https://forum.juce.com/t/reading-notes-from-midi-file/49945>\
**Category:** General JUCE discussion\
**Created:** [February 1, 2022, 1:45pm UTC](https://forum.juce.com/t/reading-notes-from-midi-file/49945 "2022-02-01T13:45:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![okmog](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@okmog](https://forum.juce.com/u/okmog)\
**Post date:** [February 1, 2022, 1:45pm UTC](https://forum.juce.com/t/reading-notes-from-midi-file/49945/1 "2022-02-01T13:45:55Z")

</div>

Hello,

I already did a search but couldn’t find something.  
Does anybody know a minimal working example to read the notes from a midi file using the juce::MidiFile class?

Best,  
okmog

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [February 1, 2022, 2:15pm UTC](https://forum.juce.com/t/reading-notes-from-midi-file/49945/2 "2022-02-01T14:15:00Z")

</div>

This should get you started, you are not supposed to read notes directly from the file, but rather get a “track” from it, which in turn contains the notes :

[https://docs.juce.com/develop/classMidiFile.html#a334aa932bc738914eb3e1578a7ee1d7c](https://docs.juce.com/develop/classMidiFile.html#a334aa932bc738914eb3e1578a7ee1d7c)
