How do you get Tempo changes? #146
-
Edit: I ended up realizing this was my fault after accidentally removing tempo changes when editing the midi file. Hey! I'm working on a new original Guitar Hero inspired game called "Guitar Classic". I'm wondering how to get the changes of tempo so that I can set the fretboard speed. I'm playing GH2 songs in my game and realizing the tempo changes multiple times throughout a song. I've tried "TempoMap.GetTempoChanges()" and that seems to get nothing, so I'm sure I just don't understand how it works. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @dreammixgames, If In MIDI file times of MIDI events are written as deltas (offsets from previous events) measured in ticks. I suppose in your file those deltas become just shorter from some point in time. But that's not a tempo change. I mean tempo change is a new Set Tempo event in a file. And if So I'm waiting for the file. |
Beta Was this translation helpful? Give feedback.
-
MidiFile file = MidiFile.Read("My MIDI file.mid"); Maxim, a beginner C# question on a similar topic: How, please, do I extract the ticks per quarter note from the "file" variable above? Sure, I see that that value very much exists, when I examine "file" with the debugger, but can't figure out the exact syntax to extract the value TicksPerQuarterNote from TimeDivision and assign it to (presumably) a "short" variable of my choosing--although I assume this is trivial and requires only one line of code. I've tried a million different solutions, none of which worked. Thanks for any guidance. |
Beta Was this translation helpful? Give feedback.
Hi @dreammixgames,
If
TempoMap.GetTempoChanges()
returns nothing then there are no tempo changes. Please provide your MIDI file and I can say more.In MIDI file times of MIDI events are written as deltas (offsets from previous events) measured in ticks. I suppose in your file those deltas become just shorter from some point in time. But that's not a tempo change. I mean tempo change is a new Set Tempo event in a file. And if
GetTempoChanges
returns nothing, there are no such events.So I'm waiting for the file.