I'm using a copy-paste of TempoCache from javax.sound.midi
to handle the tick calculations for my MIDI player, but on some files the tempo is terribly miscalculated. It seems to average the tempo from the tempo events, but I can't figure out any way to make it better.
The affected file is here: https://github.com/TechShroom/MidiShapesEL/blob/master/src/com/k/midishapes/midi/MidiUtils.java
If anything else is required, I'll add it here.