I am using this dataset of MIDI files and would like to get the durations of each note as a fraction of the pulse (rather than MIDI clock ticks). As I'm using mido in Python 3, the method ticks_per_beat provides exactly the information I need.
However, there seems to be a problem with the MIDI files themselves, as each file apparently has the same tempo (120 BPM) and ticks_per_beat (384), which are the default values. I know, however, that these are not the actual values, as when I open the MIDI files with MuseScore, it is able to read the correct tempo information from the MIDI file. When reading the MIDI files with mido, the only tempo information I can find in them is contained in the 'set_tempo' message (which sets the tempo to 120 BPM, the default). I have tried looking at the raw hex MIDI data but couldn't make much of it.
The tempo information is clearly in the MIDI file somewhere if MuseScore is able to read it, so my question is: how can I read this information from Python?