Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Midi support?

Author
Message
John Goewert
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Cornfield, MO
Posted: 6th Jan 2008 20:06
dbPlayMusic starts MP3's no problem, but I can't get midi's to load. None of the examples seem to use it, so maybe it isn't part of the GDK anymore.

Per the documentation:
Quote: "dbLoadMusic
This command will load a music file into the specified music number. The music file must be of the MIDI or MP3 format. The music number should be an integer value. "


This another bit of bad docs? Kinda like the dbSpriteCollision and dbSpriteHit stuff?
Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 9th Jan 2008 10:07 Edited at: 9th Jan 2008 10:08
Hey John,

I did some testing and got midi working on my machine. Dark GDK is notorious for not giving you enough information if something fails so I don't know what the actual problem could be. Here's the code I used to play a midi. I don't know if yours was any different. If this example doesn't work for you something else might be wrong. I've also included the midi I used (downloaded at http://www.vgmusic.com).

-Frank


Attachments

Login to view attachments
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 9th Jan 2008 21:56
I'm not sure that Midi is a good format to continue to use. Generally speaking, OGG or a Wav would be much better. Since Midi can sound different system to system, it may use the wrong instrument to play a note pattern. So for example, that really cool Drum solo might turn into some guy/woman screaming UH UH UH UH UH UH UH which would cause friends/loved ones to look into your room/office wondering what the hell you are watching on your computer.

No Kittah, this is my potpie!!!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Jan 2008 22:32
hahaha.... TRUE so TRUE!!!! Midi goes to whatever sounds are currently mapped - if the midi author stays in the general middi instruments - you're usually ok though!

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Jan 2008 22:34 Edited at: 9th Jan 2008 22:36
Quote: "So for example, that really cool Drum solo might turn into some guy/woman screaming UH UH UH UH UH UH UH"

Unlikely, I'm pretty certain there is a standard (edit: after seeing Jason's post I realise it's General MIDI) that dictates which instrument each patch is , and which percussive instrument is used for each note in drum patches.

Either way, I'd only recommend MIDI if you want smaller file sizes. Otherwise OGG is the way to go.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
John Goewert
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Cornfield, MO
Posted: 9th Jan 2008 23:06
For the jorb of love, WindowsKiller hit the nail on the head. I usually always set everything to max and just control the volume using the master volume and the midi setting was at the bottom.

When I first was playing with this, I had a side problem that was odd as well. I got a dll problem with Nero Burning Rom. It had installed some MP3 codec, probably to handle conversions to music CDs. When I compiled for the first time with dbPlayMusic("mysong.mp3"), the library tossed a fit of exceptions due to that library not having debug info. I like debug info and know there are codecs out there that are better, so I uninstalled Nero. dbPlayMusic stopped playing mp3s, while Windows Media Player still could.

Anyhow, I finally bashed my way through and found that Nero had left a broken DirectShow codec that was breaking apps that used DirectShow for Audio and since Dark GDK isn't the best at giving lots of error messages about stuff like that, it took a while to figure out.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 10th Jan 2008 17:49
Gosh that's a lot of research for midi which usually is the most reliable! So glad you resolved it though - we have enough challenges without worrying about things like midi, play song, etc blowing up. Boy wish we still had the stock DirectX animation stuff still... like playing AVI movies etc.

Login to post a reply

Server time is: 2024-11-19 23:26:30
Your offset time is: 2024-11-19 23:26:30