My goal currently is to change the tempo(speed) of the song that I parse in as a MIDI file.
Lets say I need to speed up the song by a factor of 2. This implies that the song now takes half the time to play.
Where exactly is the information related to this tempo stored? I know that there is a meta event FF 51 which is used to designate tempo changes. But from what I have read, it is for tempo-changes in real time while the music is playing. If I want to change the tempo of the entire song from start to finish, would changing all the meta events of FF 51 suffice? Also, it seems like for some MIDI files, there may not be such an event to indicate tempo changes, in which case the tempo is assumed to be 120. How do I change that by the desired amount if the event does not exist?
Furthermore, it seems like there is a relation between ticks per quarter from the header chunk, delta times, and the tempo. However, I am not able to understand this relation because of the jargon heavy music language (I don't understand a lot of the terms of music) which is available online in all the explanations. Could anyone please break it down for me?
Edit: I discovered that changing the ticks per quarter field affects the tempo. So now I am able to speed the song up and down. However, how do I make sure that the song takes in less storage as well? How would I need to change the delta times?