[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Music



It sounds like you have the basics of music down, or soon will. To have
continuously-looping music you can simply do this within your main loop:

if not pygame.mixer.music.get_busy(): ## If not currently playing... (Get
busy, child!)
pygame.mixer.music.play() ## Play it again, Pygame.

For an example of a DDR-type game that uses timing, look at the "DDRPG"
called "Tendrils" on the Pygame page. It uses separate files to store
where the beats in the song are, though.

I'm interested in dynamic music that changes based on game events, eg. in
Nintendo/Rare's "Banjo-Kazooie." Recently I played a demo of the game
"Anarchy Online" that demonstrated another technique you might look at:
chained MP3s. It looks like the music consists of short MP3s, 5-20 sec.
each, that are strung together randomly to form (say) a battle song. By
switching to a different set of MP3s you get a different music style, eg.
a darker song when you're losing the battle. Since each MP3 ends quickly,
you can use end-of-file events to trigger game events more often. I also
noted that the MP3s have several seconds of dead air at the end, as though
the game was blending each new MP3 in before the previous one ended.

Has anyone experimented with speech synthesis in Pygame? The current
technique is to record each English phoneme and not just string them
together, but adjust the pitch at the beginning and end of each so they
blend together. Can Pygame do this, short of using three versions of each
phoneme?

Kris