Archived

This topic is now archived and is closed to further replies.

How do I play a MIDI???

This topic is 5610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I am currently in a very bad situation. Me and a friend are working on a game and we decided to try and submit it to the 4e3 competition. Well I go out of town tommorow and I am the programmer so I have to finish this game today. I am have a very hard time getting our music to play. We have all of our songs in MIDI format. The only sounds I know how to play are WAVs and those are big and have bad quality and I don''t even have any WAV music. Can someone please tell me how I would play MIDIs. I know there is a function of some kind. But I don''t know what it is. I don''t have time to go and setup DirectSound and I need a simple MIDI player. Any help is greatly appreciated - Thanks a bunch

Share this post


Link to post
Share on other sites
Well, in Tricks Of The Windows Game Programming Gurus, Andre LaMothe explains how to setup DirectSound to open and play MIDI files. It''s apparently quite complex, and reading in the file itself is horrible (it takes up a lot of pages in the book:-). I''ve never tried it myself (not got that far in my engine yet), but I''d recommend TOTWGPG for it''s coverage of DirectSound.

If you want to play MP3s, you''ll need an MPEG2 or MPEG3 decoder, which you''ll have to buy, I believe. Look at Grand Theft Auto 3. It uses the Miles Sound System to play all the MP3s it uses (all of it''s sounds are actually in MP3 format), and I''m not sure how much it would be to buy in. You might want to try Wotsit''s file site, a GameDev hosted site, as they might have the MP3 file format. You can find the address on GameDev''s homepage...


Movie Quote of the Week:

"I''ve seen things you people wouldn''t believe. Attack ships
on fire off the shoulder of Orion. I watched C-beams glitter
in the dark near the Tannhauser gate. All those moments will
be lost in time, like...tears in rain. Time to die."

- Roy Batty, Blade Runner.

Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!

Share this post


Link to post
Share on other sites
No, actually, I''ve just checked, and the MPEG2 format is at Wotsit''s site (www.wotsit.org). There''s also MPEG2 decoding code written in C...


Movie Quote of the Week:

"I''ve seen things you people wouldn''t believe. Attack ships
on fire off the shoulder of Orion. I watched C-beams glitter
in the dark near the Tannhauser gate. All those moments will
be lost in time, like...tears in rain. Time to die."

- Roy Batty, Blade Runner.

Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!

Share this post


Link to post
Share on other sites
Okay I just got FMOD but it is really confusing and I can find no documentation... what code do I need for my windows DirectX program to simply set it up to play a MIDI or MP3... anyone...

- thanks

Share this post


Link to post
Share on other sites
Hi,

I think you should use DirectMusic 8.
It has simple function (see IDirectMusicLoader8::LoadObjectFromFile and IDirectMusicSegment8 and related interface in the Directx 8 SDK) for loading MIDI and MP3 file (even you don''t know the structure of the file).

If you don''t want to use DirectX, then you could use Windows Multimedia functions (I don''t know how but you should see MSDN /Platform SDK/Graphics and Multimedia Services/Multimedia Audio/Musical Instrument Digital Interface (MIDI) )

I hope this help you!

Sorry for my English but I''m Italian!


gnolo

Share this post


Link to post
Share on other sites
quote:
Original post by drdarkon
Okay I just got FMOD but it is really confusing and I can find no documentation... what code do I need for my windows DirectX program to simply set it up to play a MIDI or MP3... anyone...

- thanks



couldnt find it?!!? there is a directory called /documentation!
and heaps of examples

Share this post


Link to post
Share on other sites
Um... in the DirectX 7.0 Documentation, it has a great tutorial of how to play a midi through DirectMusic and it it really simple. About 6-7 pages including the explanation of what it does. The code is only 1 page max.

MBDYProductions - Mike Brough - Programmer

Share this post


Link to post
Share on other sites
For MIDIs, check into the MCI multimedia library. It can also execute comands to play CD tracks. I don''t know about it''s performance, though, but I do know that it''s easy to setup and use.

Share this post


Link to post
Share on other sites