A downloadable pack

Download NowName your own price

A small pack of audio-focused Creator-Defined Statements statements for Ren'Py, adding in statements for some commonly used python functions for manipulating audio to make using them easier to use and more intuitive!

StatementPython Equivalent
volume <channel> <volume> (fade <fade>)? reset?renpy.music.set_volume(volume, fade, channel)
pan <channel> <pan> (fade <fade>)? reset?renpy.music.set_pan(pan, fade, channel)
afilter <channel> <audio_filter> (fade <duration>)? replace? reset?renpy.music.set_audio_filter(channel, audio_filter, replace, duration)
audio <channel> <volume> <fade>? reset?All in one statement.
renpy.music.set_volume(volume, fade, channel)
renpy.music.set_pan(pan, fade, channel)
renpy.music.set_audio_filter(channel, audio_filter, replace, fade)

Instructions

Installation

Download AudioStatementPack.zip and unzip it to your game/ folder!

IMPORTANT
This file must be loaded BEFORE any .rpy files that use these statements. To ensure this file loads first, the file has been prefixed with 01_ by default.

(Ren'Py loads files in the Unicode sort order of their path, so make sure your script files are named appropriately).


volume

Statement equivalent of renpy.music.set_volume(volume,delay,channel)

Usage: volume <channel> <volume:float> (fade <float>)? (reset)?

Easily change the volume for any channel, with an optional "fade" duration to transition to that new volume!

Examples
Set volume of the music channel to 0.5
volume music 0.5
Set volume of the music channel to 0.8, faded over 1.0 second
volume music 0.8 fade 1.0


pan

Statement equivalent of renpy.music.set_pan(pan,delay,channel)

Usage: pan <channel> <pan:float> (fade <float>)? (reset)?

Easily change the pan setting for any channel, with an optional "fade" duration to transition to that new setting!

Examples
Set pan of the voice channel all the way to the left, fading 0.5 seconds:
pan voice -1 fade 0.5
Set the pan of the music and voice channels back to center over 1.0 second:
pan ("music","voice") 0.0 fade 1.0
Reset the pan of all channels:
pan reset


afilter

Statement equivalent of renpy.music.set_audio_filter(channel,audio_filter,duration,replace)

Usage: afilter <channel> <filter:AudioFilter> (fade <float>)? (replace)? (reset)?

Easily set the audio filter for any channel, with an optional "fade" duration to transition to that new filter!

Examples
Set filter of the voice channel to a Reverb effect, faded in over 1.0 second, replacing the current filter.
afilter voice af.Reverb(0.5) fade 0.5 replace
Set filter of the voice channel to a Reverb and LowPass effect.
afilter voice (af.Lowpass(440), af.Reverb(0.5))
Set the filter of the voice channel back to none.
afilter voice None
or
afilter voice reset
See the Ren'Py Documentation on Audio Filters for creating the filter Object and understanding how the `replace` argument works.


audio

A shorthand statement combining volume, pan, and afilter into a single statement.

Usage: audio <channel> volume <volume:float> pan <pan:float> filter <filter> replace? (fade <float>)? (reset)?

Easily change the volume, pan, and filter for any channel (or list of channels), with an optional "fade" duration to transition to the new settings!

NOTE
The keyword for the filter argument is filter, not afilter.

Examples Set volume of the music channel to 0.5 and the pan to 0.75, over 2 seconds.
audio music volume 0.5 pan 0.75 fade 2.0
Set the volume of the voice and voice2 channels to 2.0 and the give them a Reverb filter, faded in over 0.5 seconds.
audio ("voice","voice2") volume 2.0 filter af.Reverb(0.5) replace fade 0.5
Reset the volume, pan, and filter settings of all channels.
audio reset


Notes

I've done a lot of testing, but nothing really puts a script through it's paces like a full release! If you encounter any errors or problems with the script, shoot me an email at studioinstrumentality@gmail.com or join the support Discord and let me know!

Download

Download NowName your own price

Click download now to get access to the following files:

AudioStatementPack_v1.0.0.zip 2.4 kB

Leave a comment

Log in with itch.io to leave a comment.