Skip to content

Tempo changes not loaded properly #204

@lucasnfe

Description

@lucasnfe

I think there is a bug with the get_tempo_changes() function. It is not loading the tempo changes properly. Here is an example:

mid = pretty_midi.PrettyMIDI(midi_file="Undertale_PC_Undertale_Snowy.mid")
mid.get_tempo_changes() 

output:
(array([ 0.        , 15.73798337, 15.73894393]), array([60.99519764, 60.99966247, 60.99519764]))

But when I open the midi file on a midi player (e.g. GarageBand), the first ~60bpm tempo change only happens around the 5th bar. Here is a screenshot:

Screen Shot 2021-11-12 at 3 01 21 PM

If I save the midi file with pretty_midi (mid.write("Undertale_PC_Undertale_Snowy._copy.mid")) and open it with the same midi player, this is the output:

Screen Shot 2021-11-12 at 3 09 14 PM

Here are the midi file and the screenshots for reproduction:
reproduce.zip

pretty_midi 0.2.9 and python 3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions