Author Topic: FF7 and DMusic redux  (Read 4561 times)

KojiroTakenashi

  • *
  • Posts: 421
    • View Profile
FF7 and DMusic redux
« on: 2002-10-12 17:24:36 »
Hmm..How exactly does Fice's FF7 MIDI player work? Yes, yes, I know It may be a tad annoying, but I'd like to dredge up the whole FF7 w/DMusic spiel again...

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
FF7 and DMusic redux
« Reply #1 on: 2002-10-12 20:46:22 »
Um ... are we talking about FF7Music here? Well...

Basically, FF7 uses an *incredibly crap* method of decoding midis. It loads the midi itself, decodes it into various 'messages' (messages like 'play this note', 'use this instrument', etc.) itself, then streams these messages through to WinMM (Windows MultiMedia, the /old/ non-DirectX way of doing audio), WinMM then passes them onto the sound card drivers.

This is really, really bad because Windows has functions builtin to play MIDI files, including all that decoding into messages rubbish ... so why not use them? No reason - they just didn't.

Anyway - what FF7Music does is put a DLL in the FF7 folder called WinMM.DLL. So when FF7 tries to load the WinMM code, it gets my library rather than than version in Windows\System. My code then examines the messages that are going through and hopefully works out what song it is from those (by looking at which instruments it uses and notes it's playing...). Once you've got that, well, it's easy to play an MP3 instead or something. The problem, of course, is that because you're almost emulating a part of Windows, doing anything slightly wrong tends to cause crashes all over the place (not in Windows, it's not that bad, but in FF7). Also, it's not guaranteed to actually identify the song correctly, too.

Goku7

  • *
  • Posts: 1301
    • View Profile
FF7 and DMusic redux
« Reply #2 on: 2002-10-12 20:53:19 »
The main problem here with trying to use Dmusic Devices, is that the DirectMusic Engine probably can't even interface with a program that is only interfacing with windows at the DX5.0 level.

Why?

Because the DirectMusic engine was never a part of DirectX 5.0.  It wasn't until DX6, or DX6.1, that it came into being.

KojiroTakenashi

  • *
  • Posts: 421
    • View Profile
FF7 and DMusic redux
« Reply #3 on: 2002-10-12 22:06:12 »
Well, what I'm wondering is would it be possible to have FF7Music use the engine from FF7Midi?
Furthermore, how about forcing FF7 to use a DMusic device? We could see what kinda of problems develop and work from there...

Goku7

  • *
  • Posts: 1301
    • View Profile
FF7 and DMusic redux
« Reply #4 on: 2002-10-14 02:44:47 »
That's the problem.  At this point, due to how much FF7 interfaces with DX (remember, its only making DX5.0 calls to various hardware), we can't force FF7 to use a DMusic device, because FF7 doesn't even know that Dmusic devices EXIST.

We would need some MAJOR hax0ring (lol, its my lame attempt at hacker talk), to get FF7 to interface with it correctly.  More than that, though.  We'd probably need to code a whole new .exe file to get that done.

ficedula

  • *
  • Posts: 2178
    • View Profile
    • http://www.ficedula.co.uk
FF7 and DMusic redux
« Reply #5 on: 2002-10-14 12:25:14 »
Well, actually FF7Music can do that - it just uses Winamp plugins for the output (normally MP3s), but if you connect it a DirectMusic plugin, you're sorted... ;)

Of course, that relies on you getting FF7Music working first, which is not such an easy task...

KojiroTakenashi

  • *
  • Posts: 421
    • View Profile
FF7 and DMusic redux
« Reply #6 on: 2002-10-14 15:27:04 »
Dude, you're talking to a guy who got a 33 Mhz (overclocked) computer to be sufficient for 5 years. I'm sure I can play with it enough ~_^

KojiroTakenashi

  • *
  • Posts: 421
    • View Profile
FF7 and DMusic redux
« Reply #7 on: 2002-10-14 16:48:43 »
Hmm, Fice, what MIDI package is FF7music looking to? Things sound -really- off with some instruments, and my ears seem to be telling me it's not XG :\