GiudiceLab
08-18-2009, 12:43 PM
I am trying to modify some sound object properties on the fly, so I can hear the differences as I make changes. I know the changes will be updated without restarting the script, because I can make this work with presets.
I want to be able to select the property I want to change from a list and then use an input value to update the property.
def modifySettings(gr):
settings = ['Environment','EnvSize','EnvDiffusion','RoomHF','R oomLF','DecayTime','DecayHFRatio','DecayLFRatio',
'Reflections','ReflectionsDelay','ReflectionsPan', 'Reverb','ReverbDelay','ReverbPan','EchoTime','Ech oDepth',
'ModulationTime','ModulationDepth','AirAbsorptionH F','HFReference','LFReference','RoomRolloffFactor' ,'Flags']
select = viz.choose('Modify which setting?',settings)
set = viz.input('Set '+settings[select]+' to')
if settings[select] == 'Environment':
gr.Environment = set
(twenty more elifs...)
else:
print 'I cannot change that setting'
Basically, I don't want to write a bunch of if statements unless I have to, so is there a simple way of doing this? Something that would be kind of like:
gr.settings[select] = set
I want to be able to select the property I want to change from a list and then use an input value to update the property.
def modifySettings(gr):
settings = ['Environment','EnvSize','EnvDiffusion','RoomHF','R oomLF','DecayTime','DecayHFRatio','DecayLFRatio',
'Reflections','ReflectionsDelay','ReflectionsPan', 'Reverb','ReverbDelay','ReverbPan','EchoTime','Ech oDepth',
'ModulationTime','ModulationDepth','AirAbsorptionH F','HFReference','LFReference','RoomRolloffFactor' ,'Flags']
select = viz.choose('Modify which setting?',settings)
set = viz.input('Set '+settings[select]+' to')
if settings[select] == 'Environment':
gr.Environment = set
(twenty more elifs...)
else:
print 'I cannot change that setting'
Basically, I don't want to write a bunch of if statements unless I have to, so is there a simple way of doing this? Something that would be kind of like:
gr.settings[select] = set