Make the music loop from a certain point [SOLVED]

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
Meji
Newbie
Posts: 4
Joined: Wed Apr 29, 2009 2:00 pm
Contact:

Make the music loop from a certain point [SOLVED]

#1 Post by Meji »

Well, I was searching through the forums for an answer to this, but since I was unable to find any clues, I made a new thread.

Is it possible to make your song loop from a certain point to another? For example, when you first hear the song, there's this legendary intro that is followed by an epic refrain. But, I only want the player to hear the intro once, letting the refrain loop for infinity.

So, simply put, my question is: it it possible choose from where your song loops?
Last edited by Meji on Sat May 02, 2009 10:21 am, edited 1 time in total.

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: Make the music loop from a certain point

#2 Post by PyTom »

Code: Select all

play music "intro.ogg"
queue music "refrain.ogg"
You have to chop it up into two files, and queue the second one, which will loop.
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

Satoh
Regular
Posts: 65
Joined: Tue Apr 28, 2009 5:31 pm
Contact:

Re: Make the music loop from a certain point

#3 Post by Satoh »

I don't mean to steal the thread but, can sounds be looped, or should I just play my repeating sounds as music instead?

For instance I have a clock ticking sound I want to play continuously until the end of a particular scene, but in the reference manual there is no mention of sound effects being repeatable... If I set the SFX up as a music, it can still overlap the other music without stopping it correct?

(I didn't feel it required an entire thread, sorry if this is too unrelated.)
Not the man I was before... He was an insufferable sort...

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

Re: Make the music loop from a certain point

#4 Post by EvilDragon »

Satoh wrote:If I set the SFX up as a music, it can still overlap the other music without stopping it correct?
Yes, you just need to declare a new channel and play it on that channel, the music plays in another channel so it won't collide.
Angels of paradise, angels of sacrifice
Please let me be under your wings...

Meji
Newbie
Posts: 4
Joined: Wed Apr 29, 2009 2:00 pm
Contact:

Re: Make the music loop from a certain point

#5 Post by Meji »

Thank you so much. Problem solved. <3

Post Reply

Who is online

Users browsing this forum: baguetti, Ocelot