The Daily Click ::. Forums ::. Klik Coding Help ::. How do i make TGF load the music faster and not have massive pauses whenever a midi loads?
 

Post Reply  Post Oekaki 
 

Posted By Message

Jimmy Pig



Registered
  21/02/2004
Points
  568
3rd October, 2004 at 09:24:27 -

I need help making my Gfactory load music faster, because i all of the pats on the games using timed pieces if yo put music there it takes ages to load and f**ks about wih all the timed stuff if you know what im talking about, thanks a lot.

 
The Hangy creator! SHOOT ME NOW!!!11!

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
3rd October, 2004 at 11:25:57 -

It's impossible because that's more a problem with your soundcard drivers than anything else. To avoid the gaps, you'll have to use WAV/MP3 instead.

 
n/a

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
3rd October, 2004 at 20:27:29 -

You could use the MCI object to play MIDIs instead of loading them internally from the file, which has performance improvements. To do this:

1. Create an MCI object
2. Set the device name to: midisequencer
3. Set the pause command to: pause
4. Set the resume command to: resume
5. Set "Open MCI Device Driver at Start of Frame" to OFF
6. Set "Close MCI Device Driver and End of Frame" to OFF
7. Set "Close Sound Device before Sending Command" to OFF
8. Set "Display all Error Messages" to ON
9. In the event editor, to open a MIDI send the action: "OPEN blah.midi AS music"
10. To start the MIDI playing, send the action: "PLAY music FROM 0"
11. To stop the MIDI playing, send the action: "STOP music"
12. To close the MIDI, send the action: "CLOSE music"

Other useful actions are: "PAUSE music" and "RESUME music"

Note: MIDIs defined in this context are handled by Windows, and as such you will need to STOP and CLOSE the MIDI when the application ends otherwise it will continue to play and the file handle will not be destroyed. The best way to do this is to create either an "end of frame" or "end of application" event (depending on the context) to run those two commands, rather than applying it to a close button, etc, as this will also stop the MIDI if the user presses ALT+F4 or uses the Windows Close button.

I hope this helps.

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert

醤油の兵士

Almost Human

Registered
  12/06/2002
Points
  173

VIP Member
4th October, 2004 at 00:08:03 -

I think all the clicks tools at this moment load the MIDI into memory, whereas all the extensions stream the file allowing for no load time.

 
As a boy, I wanted to be a train. I didn’t realize this was unusual—that other kids played with trains, not as them.

BlackMageJawa



Registered
  29/11/2002
Points
  30
10th October, 2004 at 10:43:58 -

Hmm... can you use that so that it won't stop the midi when you change frames as well?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click