One way for MIDI...

Advanced game related topics
Skipsy
User
User
Posts: 98
Joined: Wed Apr 30, 2003 12:26 pm
Location: France

One way for MIDI...

Post by Skipsy »

Hi folks,

I use PlayMovie to play MIDI music :

Code: Select all

If LoadMovie( #MUSIC, ".\snds\music.mid") = 0
  MessageRequester("Error", "Error opening: popcorn.mid", 0) 
EndIf

PlayMovie( #MUSIC, ScreenID() )
My understanding is that I am using Windoz movie player just for music.
It sounds like a "brute" way...
As music is playing during my game is running I am afraid it could
slow it down (?)

Do you know a cleanner way to play MIDI file ? I have had look in the
previously posted questions but found out nothing (that I understand)
:oops:

Thks guys,
Beware of the man who has the solution before he understands the problem...
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

in the IncludePack1 for jaPBe you find a MIDI.PBI.

Try this.

GPI
Skipsy
User
User
Posts: 98
Joined: Wed Apr 30, 2003 12:26 pm
Location: France

Post by Skipsy »

That pack is MAGIC !!!

I read it uses MCI...what about compatility with different windows
versions (MCI prerequisites)

Great job, thanks.
Beware of the man who has the solution before he understands the problem...
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Skipsy wrote:That pack is MAGIC !!!

I read it uses MCI...what about compatility with different windows
versions (MCI prerequisites)

Great job, thanks.
Should work on Win98SE and XP.

btw: When you need to change to volume, you should try the VolumeMute.pbi, but don't forget to reset the volume to the old value.

p.s.: With jaPBe, you can "link" the include in the compiler-options.
Ralf
Enthusiast
Enthusiast
Posts: 203
Joined: Fri May 30, 2003 1:29 pm
Location: Germany

Post by Ralf »

really nice pack. is there any way to catch a midi without saving a file to disk/hd and play it direct from memory location. "PlayMidi(?label)" !?
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

Sorry, don't found a mci-command for this...

But you can depack the mid in the temp-folder...

(include system.pbi)

Code: Select all

path$=CreateTempDirectory ()

.
.
.

DeleteDirectory(path$,"*.*",#PB_FileSystem_Recursive|#PB_FileSystem_Force)
Post Reply