Page 1 of 1

Audio volume adjustment help neeeded & screen movement help

Posted: Fri Jul 17, 2015 6:19 pm
by alerionepisode
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:

Re: Audio volume adjustment help neeeded & screen movement h

Posted: Fri Jul 17, 2015 6:51 pm
by trooper6
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

Re: Audio volume adjustment help neeeded & screen movement h

Posted: Fri Jul 17, 2015 6:55 pm
by Donmai
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

Re: Audio volume adjustment help neeeded & screen movement h

Posted: Sat Jul 18, 2015 4:16 am
by alerionepisode
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!)

Re: Audio volume adjustment help neeeded & screen movement h

Posted: Sat Jul 18, 2015 9:55 am
by Donmai
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.

Re: Audio volume adjustment help neeeded & screen movement h

Posted: Sat Jul 18, 2015 2:31 pm
by alerionepisode
Thank you that worked perfectly!