Extending renpy.music.set_pan() ?! [answered]

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
Jo'ogn
Veteran
Posts: 398
Joined: Sat Jul 12, 2008 1:31 pm
Projects: Kassiopeia [iVN]
Location: Deutschland
Contact:

Extending renpy.music.set_pan() ?! [answered]

#1 Post by Jo'ogn »

@PyTom - I am working on sound design for an extensive Project (Hi, Mikey ; ) and I could now make use of a renpy.music.set_pan() that has more useful functionality. Sth that we call LFO (low frequency oscillator) in synthesizers. Sth comparable to the "bounce" functionality on the graphical side:

e.g.
a) I want to place the sfx a bit to the left of the actual center:

Code: Select all

renpy.music.set_pan( -0.5 ) 
b) then I want it to pan around 25% this point. I.e. it would pan between -0.75 to -0.25

Code: Select all

pan_modulation_depth=0.25
c) This all shall happen at a given speed of, e.g. 0.5Hz. I.e. it takes 2 seconds to pan from -.25 to -.75 and back to -.25

Code: Select all

pan_modulation_speed=0.5
d) it shall keep doing this repeatedly until I tell it to stop, or just once.

Code: Select all

pan_modulation_mode=once|loop
~
d) would also improve the limited functionality set_pan has at the momet: set_pan() does have a "delay", but this pans only a sound from center to the given new panorama-position. In practise one might want to pan from one point in the panorama to another. E.g. having a car passing by from left to right, which is not possible with the set_pan() atm.
~
Sythesizers go a step further allowing a couple of waveforms how the panning shall be executed. Like "sawtooth", "square", "triangular", "sinus" (not unlike "ease" in ATL), "random"... But I believe a simple linear pan would do nicely in most cases.


Do you feel like implementing such an audio functionality? ^_^b
Last edited by Jo'ogn on Sun Apr 04, 2010 1:34 pm, edited 1 time in total.
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english

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: Extending renpy.music.set_pan() ?!

#2 Post by PyTom »

This isn't something I'll implement, but you should be able to use config.periodic_callback (a function that is called 20 times a second) to implement it yourself.

You can pan from left to right by immediately setting the pan to the left, and then delay-panning it to the right.
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

Jo'ogn
Veteran
Posts: 398
Joined: Sat Jul 12, 2008 1:31 pm
Projects: Kassiopeia [iVN]
Location: Deutschland
Contact:

Re: Extending renpy.music.set_pan() ?! [answered]

#3 Post by Jo'ogn »

PyTom wrote:You can pan from left to right by immediately setting the pan to the left, and then delay-panning it to the right.
Oha, thanks. That indeed works now as intended!
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english

Post Reply

Who is online

Users browsing this forum: No registered users