MuseScore MIDI file tempo + note duration analysis algorithm

• Jul 25, 2022 - 14:59

I am currently working on a project involving the analysis of several thousand MIDI files, all of which have no time signature, tempo, or MIDI "tick per beat" information contained within them. Obtaining all this data is a crucial part of the project and due to the number of MIDI files it would be extremely cumbersome to simply manually label them.

I have noticed, however, that MuseScore is somehow able to calculate all this information from the MIDI files anyway when I import them. Therefore, I assume that MuseScore has some sort of algorithm built in for the analysis of tempo, time signature, etc. and due to the open-source nature of the program, the code for the MIDI import analysis should be readily available in the GitHub repo.

However, due to my lack of knowledge on the MuseScore project I have no idea where the relevant code is located within the MuseScore codebase. Therefore my question is: could someone either explain to me how the algorithm roughly works (or simply point me to the code on GitHub)? Many thanks in advance.


Do you still have an unanswered question? Please log in first to post your question.