Music: Possible to set a loop point?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Fawkes - Feathered Melody
Regular
Posts: 93
Joined: Wed Sep 13, 2006 11:29 am
Contact:

Music: Possible to set a loop point?

#1 Post 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.
Image
Writer / Programmer
Crows Project: Released 12/15/07
Noctua: In Development. Demo 3 released.
Project Silk Road: Planning/Story Construction
"Live while awake. Live while dreaming."
We have a [new] website again!

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Music: Possible to set a loop point?

#2 Post 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"
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

EvilDragon
Veteran
Posts: 284
Joined: Fri Dec 28, 2007 5:47 am
Location: Where the Dragons rule!
Contact:

Re: Music: Possible to set a loop point?

#3 Post 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?
Angels of paradise, angels of sacrifice
Please let me be under your wings...

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Music: Possible to set a loop point?

#4 Post 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.
Server error: user 'Jake' not found

EvilDragon
Veteran
Posts: 284
Joined: Fri Dec 28, 2007 5:47 am
Location: Where the Dragons rule!
Contact:

Re: Music: Possible to set a loop point?

#5 Post by EvilDragon »

Good points, Jake :D
Angels of paradise, angels of sacrifice
Please let me be under your wings...

Post Reply

Who is online

Users browsing this forum: Nozori_Games, Ocelot