Fadein Fadeout music doesn't work well?

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
DeletedUser160413

Fadein Fadeout music doesn't work well?

#1 Post by DeletedUser160413 »

I'm trying to slowly fadeout and fadein the music that I'm playing in my VN, but even if I change the seconds of the fade, it still just cuts abruptly and starts the music abruptly. I want the music to fade out really slow, like become more quiet by the second, and not just end in an instant when I stop it.


I've tried:

play music "audio/x.mp3" fadein 1.0 fadeout 1.0

play music "audio/x.mp3" fadein 2.0

stop music fadeout 1.0

etc.

What can I do to fade it slower?

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Fadein Fadeout music doesn't work well?

#2 Post by Asceai »

Works fine for me:

Code: Select all

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"

# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")

# The game starts here.
label start:
    play music "audio/x.mp3" fadein 1.0
    e "You've created a new Ren'Py game."
    stop music fadeout 1.0
    e "Once you add a story, pictures, and music, you can release it to the world!"

    return
If you want it to fade out 'really slow' you probably want a higher value than 1, though, since that's 1 second, but otherwise it seems to work fine here.

User avatar
Keinart
Regular
Posts: 133
Joined: Sun May 13, 2012 8:28 pm
Completed: One Thousand Lies
Projects: Lotus Reverie
Organization: Keinart Lobre
Tumblr: keinart
itch: keinart
Location: Spain
Contact:

Re: Fadein Fadeout music doesn't work well?

#3 Post by Keinart »

As Ascei mentioned, try a longer time. I usually go for fadeout 4.0 and fadein 6.0 for my project, even more in some cases.

Also, I think you need to put fadeout first and then fadein later, since you need to fadeout the actual music before you can fadein the new one.

Instead of > play music "audio/x.mp3" fadein 1.0 fadeout 1.0 > try > play music "audio/x.mp3" fadeout 1.0 fadein 1.0

DeletedUser160413

Re: Fadein Fadeout music doesn't work well?

#4 Post by DeletedUser160413 »

Yeah, that seems to be the problem. Thank you both :)

Post Reply

Who is online

Users browsing this forum: Sugar_and_rice