Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Game->GetMIDI() / Game->PlayMIDI()

4 replies · 1,282 views · Started 05 May 2009

Game->GetMIDI() currently returns 1 - [strike]7[/strike] 6 if it's a built in MIDI, or >= [strike]8[/strike] 7 if it's a custom MIDI. It returns 0 if there's no music playing.

Game->PlayMIDI() accepts 0 for no music, or >= 1 for custom music. I do not know if you can play built in MIDIs via this command.

Here's a better idea:

Have Game->GetMIDI() return 0 for no music, >= 1 for custom music, and <= -1 for built in music. Have Game->PlayMIDI() accept the same parameters. That way, you can pass Game->GetMIDI() directly to Game->PlayMIDI(), and have it work as expected. (Or, more likely, save the result of Game->GetMIDI(), and feed it to Game->PlayMIDI() later)

So subtract 6 from the current midi before returning the function?
That's probably a good idea.

I don't know. currently, it plays custom ones, starting from 1. I've never tried passing negative values.