[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [pygame] Fwd: Multiple Music Files




Assuming Windows - if the midi sequencer in mmsystem is still the same
as it was when created, I seem to remember from debug output during
development that
it pre-scans the whole file before it starts playing - perhaps
looking for bogus timing or unsupported patches, etc? I
may be misremembering, though. But I would think this would be pretty
darn fast on today's processors. If you're willing to make
windows MCI calls directly (eschewing SDL for MIDI), you should be able to
pre-load
as many MIDI's as you want and play them when you're ready.
(MCI OPENs and then MCI PLAYs - but it's been a while...)


-----Original Message-----
From: owner-pygame-users@seul.org [mailto:owner-pygame-users@seul.org]On
Behalf Of Pete Shinners
Sent: Tuesday, July 09, 2002 1:11 PM
To: pygame-users@seul.org
Cc: tim@lesher.ws
Subject: Re: [pygame] Fwd: Multiple Music Files


Pete Shinners wrote:
> I'm playing around with porting an existing game to PyGame.  The
> existing game has music in a largish number of individual MIDI files,
> which get played contiguously.  In the existing game, the next MIDI file
> is preloaded before the current one is finished, so there is no latency
> between one ending and the next beginning; however, it doesn't seem to
> work that way in PyGame.
>
> Looking at the SDL mixer docs, it doesn't seem to be a restriction
> there, since music gets loaded into its own "handle".  Is there a reason
> that PyGame couldn't support this?
>
> Thanks.


well, this was a design decision in pygame (hopefully for the
better). since SDL_mixer only supports a single playing music
channel, i designed the 'music object' to work more like a singleton
object (meaning there is always only one)

my big question is, are you getting a delay between midi tracks? i
was pretty sure the midi is "streamed" as it plays, so there
shouldn't be any loading time? perhaps this is not the case? are you
on windows i wonder? on windows SDL now uses 'native' midi plaback,
but i was under the impression it was still streamed.. perhaps not?

if you really are getting a delay between songs, i have no problem
adding some kind of workaround. it would probably be along the lines
of "music.queue(next_song)", which would automatically play when the
current song ends (plus preload it so there's no delay)

(actually, someone has already asked for this sort of thing for
regular Sound and Channel objects, so maybe it's time to get it in)

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org