Page 1 of 1

Music: Possible to set a loop point?

Posted: Sun Jun 15, 2008 9:44 pm
by Fawkes - Feathered Melody
Is it possible to command the Renpy to loop the music at a point other than the beginning of the song?

Thanks in advance.

Re: Music: Possible to set a loop point?

Posted: Sun Jun 15, 2008 10:19 pm
by PyTom
What you want to do is to divide the music into two parts, and then do something like:

play music "start.ogg"
queue music "rest.ogg"

Re: Music: Possible to set a loop point?

Posted: Mon Jun 16, 2008 2:38 am
by EvilDragon
Maybe implementing a possibility in renpy to recognize if the music file has loop points? Or is this connected to SDL library's possibilities?

Re: Music: Possible to set a loop point?

Posted: Mon Jun 16, 2008 5:57 am
by Jake
EvilDragon wrote:Maybe implementing a possibility in renpy to recognize if the music file has loop points? Or is this connected to SDL library's possibilities?
To my knowledge there's no standard format for including such metadata in MP3s or OGGs or other wave-type sound files, so to do such a thing would require the engine to analyse the waveform and work out what time it was in, what tempo (bearing in mind both - along with the key - can and do change mid-song sometimes) and so on, which is a pretty hard task already. Then the engine would have to identify recurring elements in the music or phrases which could recur without sounding bad, and make guesses at which ones are desired. Sometimes it would be relatively easy, but most of the time it's a difficult task. It would definitely require a programmer with a sound knowledge of music theory and DSP at the same time, and I expect that even if PyTom does have that knowledge he'd probably consider it well outside of the scope of a VN engine when it's far simpler for the composer to separate out looping sections when they render the track out in the first place.

Re: Music: Possible to set a loop point?

Posted: Mon Jun 16, 2008 6:44 am
by EvilDragon
Good points, Jake :D