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

Re: [pygame] Fwd: Multiple Music Files



>> 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.

> 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)

Just a few cents of personal knowledge here;

A lot of people store MIDI instructions at the beginning of MIDI files, such 
as setting channel volumes, panning, vibrato, instruments, tempo, etc.

As a general rule for someone setting information at the front of the music, 
it lasts a bar or some amount of musical measure. Thus, while the MIDI 
sequencer is setting instrument information, there's a second or so of 
silence. This may be the delay that's being experienced, and possibly why 
two MIDI handles are being requested. Some people do it with XM/MOD trackers 
too.

B
-- 
*  tgz@orotech.net  *  http://clickass.org  *  ICQ# 1107012  *  AIM/Yahoo: 
theGREENzebra  *  http://mp3.com/thegreenzebra
-----GEEK CODE 3.12-----
GCM/CS/IT/MU d? s: a22 C++++ UL++++ P+ L+++>$ E---- W++ N+ o K- w---$ O- M 
V-- PS+ PE Y+ PGP- t++(+++) 5- X R tv(+) b+(-) DI+++ D+ G++ e h++ r+(---) y+ 
UF*++

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