The Daily Click ::. Forums ::. Klik Coding Help ::. Erm why isnt my midi file not playing
 

Post Reply  Post Oekaki 
 

Posted By Message

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
18th November, 2010 at 14:56:17 -

So i use files for everything in my games, like the tileset, animations music, is all retrieved from an external source.. So how come when i try to to play a midi file from a file its not working now, when i have blatently done this before.

um the expression is somthing like:

appdir$+"\Music\"+"songname.mid"

any ideas why it isnt playing, i have triple check all the names of the folders and files are correct.
Oh, but it works if i use the MMF function "play midi", but i want to get it from a file, so why isnt it working???
any ideas?

 
dont make me divide by zero...

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
18th November, 2010 at 14:59:29 -

have you tried appending appdrive$ to the beginning?

appdrive$+appdir$+"\Music\"+"songname.mid"



Edited by GamesterXIII

 
n/a

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
18th November, 2010 at 15:02:45 -

Thanks for reply, i tried it, but no luck. Im really confused, ive never had this sort of problem before, doesnt seem to make sence. Im sure theres some explanation though...

 
dont make me divide by zero...

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
18th November, 2010 at 15:13:15 -

Infact,it cant be the route of the file thats the problem coz i put the whole path in from c:\ and it still didnt work

 
dont make me divide by zero...

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
18th November, 2010 at 15:29:08 -

try eliminating the music folder - temporarily. Just use appdrive$+appdir$+songname.mid, build an exe, move the midi file into the same folder as the exe, then see if that helps.

That will at least eliminate one possibile problem.





 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
18th November, 2010 at 16:10:30 -

Are you making it as a .swf? I don't know how MMF reacts to midis during development, but I know they don't work for flash.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
18th November, 2010 at 16:31:04 -

nope, its standard build :s

 
dont make me divide by zero...

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
18th November, 2010 at 18:02:14 -

Hmm, well I'm stumped.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Søren Jensen



Registered
  10/11/2010
Points
  20
20th November, 2010 at 06:34:52 -

appdrive$+appdir$+"\Music\"+"songname.mid"

you got a \ to much, appdir$ and appdrive$ adds its own \
so basicly ur line reads like this:
c:\game\\Music\songname.mid

what you want is

appdrive$+appdir$+"Music\"+"songname.mid"

Edited by Søren Jensen

 
n/a

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
20th November, 2010 at 07:53:57 -

If you run into further trouble, try to output it as a string, then you'll be able to figure out exactly what's up.

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2723
20th November, 2010 at 18:25:49 -

Probably removing that extra slash did the trick, but if it didn't, I've got some old TGF code for the MCI object which plays midi files.

You could send the following command: "open %drive%%dir%midifile.mid alias tune"
then send: "play tune" or "stop tune"
and don't forget to close the tune by sending: "close tune"

A cool feature from the MCI object is that it can keep playing the same midi file between multiple frames, without starting over again


 
Image jenswa.neocities.org

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
21st November, 2010 at 18:55:55 -

Oh kwl thanks Jenswa il try that! never actualy used the MCI object.

 
dont make me divide by zero...

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
23rd November, 2010 at 12:29:48 -

Hey guys, is their anywhere i can learn more about the MCI object, like the commands it receives and different functions it has?

 
dont make me divide by zero...

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
23rd November, 2010 at 12:33:52 -

atm its saying please supply an alias or drive or somthing... i have pretty much copy pasted your expression.

 
dont make me divide by zero...

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
24th November, 2010 at 10:57:33 -

"why isn't my midi file not playing"

you be trollin!!! lol.

 
n/a

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
24th November, 2010 at 17:31:29 -


Originally Posted by Zephni
atm its saying please supply an alias or drive or somthing... i have pretty much copy pasted your expression.



Like I said before, paste that same expression into a string, and you'll see what's wrong with it.

Edited by HorrendousGames

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2723
3rd December, 2010 at 11:14:37 -

Sorry I couldn't be much more of a help, or for my late reply.

Got it working already? If not I've uploaded an example file over here:
http://www.gouwevrouwe.nl/files/mci-test.zip

But basically copying and pasting the strings should work.

The command: "open %drive%%dir%midifile.mid alias tune" opens the midifile.mid and gives it the alias tune.
That way you can play or stop the midifile.mid with the commands: "play tune" or "stop tune".
So the alias tune refers to the name of the midifile.


 
Image jenswa.neocities.org

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
4th December, 2010 at 12:11:06 -

Thankyou very much Jenswa your a great help

 
dont make me divide by zero...
   

Post Reply



 



Advertisement

Worth A Click