Audio volume adjustment help neeeded & screen movement help

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
alerionepisode
Newbie
Posts: 3
Joined: Fri Jul 17, 2015 6:07 pm
Contact:

Audio volume adjustment help neeeded & screen movement help

#1 Post by alerionepisode » Fri Jul 17, 2015 6:19 pm

Hello, this is my first time posting here and first time creating a VN.
I'm getting used to writing my scripts and I need a hand and I've searched but not found anything clear.
I am wondering if there was a way to make the music quieter or the sound effects louder, the music I'm using is so loud you cannot hear the characters etc.

and possibly worded in a way for a person new to Ren'Py to understand would be great.

The second question is
How do you make the screen shake? ie. when a character shouts/jumps/is panicked and the screen kinda has a mini earthquake to emphasize the reaction ? :lol:
Thank-you and I hope this is in the right section etc c:

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Audio volume adjustment help neeeded & screen movement h

#2 Post by trooper6 » Fri Jul 17, 2015 6:51 pm

The answers to your questions are all in the documentation...have you checked out the documentation?

Anyway, to answer your questions.
The first is about changing the volume on your various sound channels.

From a sound engineering perspective, it is best for you to normalize the sound levels of all your various audio files using a sound editing program (like Audacity, which is free), before you run around changing volumes in the game. If, for example, your character voices were recorded at too low a volume and you don't compress and normalize those voices, but your music was compressed and has good volume? You can reduce the volume of the music, but it will be hard to do much because you are struggling against vocals that are just too low. It is best to have everything at the right base level, and then use volume for in the moment effects.

But here is how you do it.
The relevant page of the documentation is here: http://www.renpy.org/doc/html/audio.html
The very specific part is here: http://www.renpy.org/doc/html/audio.htm ... set_volume

So you are playing your music:

Code: Select all

play music "mozart.ogg"
You want to lower the volume of the music channel then you just use renpy.music.set_volume()

So you'd type in:

Code: Select all

$renpy.music.set_volume(0.2, 0, 'music')
On to the second question. Shaking the screen is called vpunch or hpunch (for vertical shake and horizontal shake)
These are both transitions. This is documented here: http://www.renpy.org/doc/html/transitions.html

So you can show an image:

Code: Select all

show mary_sue
with punch
You can also do it with text. (This is shown in the documentation here: http://www.renpy.org/doc/html/dialogue. ... -statement)

Code: Select all

"Marty Stu bumps into you in the lunch room."
"Oh my gosh!" with hpunch
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Audio volume adjustment help neeeded & screen movement h

#3 Post by Donmai » Fri Jul 17, 2015 6:55 pm

Welcome to the forum (yes, you have come to the right place :) ).
Okay, as a non-English speaker, I've revised my answer so many times that Trooper beat me again :lol: . Anyway, here it goes:

You can find the command to control the music volume here: http://www.renpy.org/doc/html/audio.htm ... set_volume
Basically you would do something like

Code: Select all

$ renpy.music.set_volume(.5, 0, channel = "music")
In the above example you're setting the music volume to half it's initial value.
(the $ sign is important because this is in fact a line of python code)

The easiest way to shake the screen is by using the vpunch or hpunch transitions:

Code: Select all

scene name_of_your_background
show name_of_your_sprite
with vpunch
You can play a sound at the same time, for a great effect.

For an earthquake, a more sophisticated non-default transition that can shake the screen in several directions with adjustable duration time is the python "shake effect": http://www.renpy.org/wiki/renpy/doc/coo ... ake_effect
Do a search for "shake effect" and you will find several threads discussing how to better use this effect, like this: http://lemmasoft.renai.us/forums/viewto ... =8&t=29466
Last edited by Donmai on Sat Jul 18, 2015 12:35 pm, edited 1 time in total.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

alerionepisode
Newbie
Posts: 3
Joined: Fri Jul 17, 2015 6:07 pm
Contact:

Re: Audio volume adjustment help neeeded & screen movement h

#4 Post by alerionepisode » Sat Jul 18, 2015 4:16 am

Yes I did read the documents but for a completely new Ren'Py user I found it difficult to understand completely and had no idea what exactly I was looking for :oops:
Donmai wrote:Welcome to the forum (yes, you have come to the right place :) ).
Okay, as a non-English speaker, I've revised my answer so many times that Trooper beat me again :lol: . Anyway, here it goes:

You can find the command to control the music volume here: http://www.renpy.org/doc/html/audio.htm ... set_volume
Basically you would do something like

Code: Select all

$ renpy.music.set_volume(.5, 0, channel = "music")
In the above example you're setting the music volume to half it's initial value.
(the $ sign is important because this is in fact a line of python code)
You can play a sound at the same time, for a great effect.


Where exactly does this code go? and does it change every piece of music or do you have to input it every time I use a new song?
Thanks for taking your time to reply to me! :)

(Oh and the shake worked like a charm! thanks!)

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Audio volume adjustment help neeeded & screen movement h

#5 Post by Donmai » Sat Jul 18, 2015 9:55 am

You can use that line of code whenever you want to change the "music" sound channel volume. Let's say your character is outside a cafe, hearing the music that is playing inside:

Code: Select all

$ renpy.music.set_volume(.25, 0.0, channel = "music") #music playing very low
play music cafe_song
scene outside_cafe
show your_character_sprite
with dissolve
c "Oh, they're playing a nice music there. I think I will enter."
play sound door_open
$ renpy.music.set_volume(1.0, 0.0, channel = "music") #now music plays at full volume
scene inside_cafe
show your_character_sprite happy
with dissolve
c "Wow! What a nice place!"
Any song you play from now on will play at full volume, until you change it again.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

alerionepisode
Newbie
Posts: 3
Joined: Fri Jul 17, 2015 6:07 pm
Contact:

Re: Audio volume adjustment help neeeded & screen movement h

#6 Post by alerionepisode » Sat Jul 18, 2015 2:31 pm

Thank you that worked perfectly!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]