You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to control mixer volumes through custom callbacks but that doesn't seem to work. I think the only thing that works is when I setup the server (which is Flask) and declare the values, when I try to change an amp value with a socket after the server starts, it takes no effect. I have a setup similar to #182, like this:
audio_server = pyo.Server(sr=44100, nchnls=2, buffersize=512)
audio_server.boot()
audio_server.start()
background_audio_table = pyo.SndTable("background.wav")
background_freq = background_audio_table.getRate()
background_sound = pyo.Osc(table=background_audio_table, freq=background_freq, mul=1)
audio_mixer = pyo.Mixer(outs=2, chnls=2) # this is the end of the chain
audio_mixer.addInput(0, background_sound)
# i will then add 0->n based on the nr of sounds I'll add and set the amp nr respectively
audio_mixer.setAmp(0,0,1)
audio_mixer.setAmp(0,1,1)
audio_mixer.out()
I then have some callbacks on the keyboard that will call functions in the server file, with methods like:
This should put the volume of the background track to 0 right? Anyhow the audio doesn't stop, and to be honest doesn't seem to change at all (qualitative opinion). Any idea how to solve this?
Thanks
The text was updated successfully, but these errors were encountered:
The function "_loremipsum" is declared in your server file, but are you sure that the call doesn't actually occurs in another thread?
When used locally, it works as expected:
import pyo
audio_server = pyo.Server(sr=44100, nchnls=2, buffersize=512)
audio_server.boot()
audio_server.start()
background_audio_table = pyo.SndTable(pyo.SNDS_PATH+"/transparent.aif")
background_freq = background_audio_table.getRate()
background_sound = pyo.Osc(table=background_audio_table, freq=background_freq, mul=1)
audio_mixer = pyo.Mixer(outs=2, chnls=2) # this is the end of the chain
audio_mixer.addInput(0, background_sound)
# i will then add 0->n based on the nr of sounds I'll add and set the amp nr respectively
audio_mixer.setAmp(0,0,1)
audio_mixer.setAmp(0,1,1)
audio_mixer.out()
def _loremipsum(data):
audio_mixer.setAmp(0, 0, 0)
audio_mixer.setAmp(0, 1, 0)
audio_server.gui(locals())
Hello all.
I am trying to control mixer volumes through custom callbacks but that doesn't seem to work. I think the only thing that works is when I setup the server (which is Flask) and declare the values, when I try to change an amp value with a socket after the server starts, it takes no effect. I have a setup similar to #182, like this:
I then have some callbacks on the keyboard that will call functions in the server file, with methods like:
This should put the volume of the background track to 0 right? Anyhow the audio doesn't stop, and to be honest doesn't seem to change at all (qualitative opinion). Any idea how to solve this?
Thanks
The text was updated successfully, but these errors were encountered: