Page 1 of 1

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

Posted: Sat Mar 13, 2010 3:56 pm
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

Re: Extending renpy.music.set_pan() ?!

Posted: Sat Mar 13, 2010 5:44 pm
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.

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

Posted: Sun Apr 04, 2010 1:34 pm
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!