. orion,
. yes, it is possible to modulate more than one parameter, but that would require some additional coding.
. the values for fxMod (the high and low values) and useFX (which effect that is currently being used) are set in MessageEvent()
. for example, if we use effect 5 -
fxList[5] = {'FILTER': '(CI) Circular Screen', 'PARAMETERS': {'Width': 0.385, 'Center Y': 0.5, 'Center X': 0.5, 'Sharpness': 0.565}}
fxMod[5] = {'NAME' : 'Width', 'PARAMS': {'low' : -0.2, 'high' : 0.6 , 'default': 0.4, 'type': 'real'} }
. based on the 120 avFX module - most of the work is done in PeriodicalEvent() -
Code: Select all
if fxActive[0] :
modVal[0] = ( (fxMod[useFXindex[0]]['PARAMS']['high'] - fxMod[useFXindex[0]]['PARAMS']['low'] ) * mod0 + fxMod[useFXindex[0]]['PARAMS']['low'] )
modName[0] = fxMod[useFXindex[0]]['NAME']
useFXlist[0]['PARAMETERS'][modName[0]]= modVal[0]
. i have the two arrays of dictionaries (which i've since moved towards a single dictionary definition for effects ) that are associated by their index (5, in this case)
. fxMod[] - give the name of the parameter for the effect (called modName[0] above) -Width - and my high and low values. the above code calculates the range of values to be used and sets the value of that parameter.
. when doing effects, the basic flow is: update the effect values, clear the effects, push the new effect parameters into the effect -
Code: Select all
##
## clear and update effects
modul8.setFilters([{},{}],0,False)
modul8.setFilters(useFXlist,0,False)
. so, to answer your question (finally
) - if you were modifying the 120 avFX module, you could create another array - with the second parameter you want to modulate... .ie,
fxList[5] = {'FILTER': '(CI) Circular Screen', 'PARAMETERS': {'Width': 0.385, 'Center Y': 0.5, 'Center X': 0.5, 'Sharpness': 0.565}}
fxMod[5] = {'NAME' : 'Width', 'PARAMS': {'low' : -0.2, 'high' : 0.6 , 'default': 0.4, 'type': 'real'} }
fxMod2[5] = {'NAME' : 'Sharpness', 'PARAMS': {'low' : 0.1 , 'high' : 0.6 , 'default': 0.4, 'type': 'real'} }
. then add code into the topmost block i quoted to adjust the second parameter (Sharpness in this example)
. remember the 'NAME': part in fxMod isn't arbitrary, it must be a parameter in the effect definition. for some effects, like Pixellate - you might only have one parameter you wish to change -
fxList[0] = {'FILTER': '(CI) Pixellate', 'PARAMETERS': {'Center X': 0.5, 'Scale': 0.075, 'Center Y': 0.5}}
fxMod[0] = {'NAME' : 'Scale', 'PARAMS': {'low' : 0.0, 'high' : 0.2, 'default': 0.075, 'type': 'real'} }
. so, if you did the fxMod2[0] method, you might set the name to 'NONE' so it will be ignored...
fxMod2[0] = {'NAME' : 'NONE', 'PARAMS': {'low' : 0.0, 'high' : 0.2, 'default': 0.075, 'type': 'real'} }
. then the above code could be changed to
Code: Select all
if fxActive[0] :
modVal[0] = ( (fxMod[useFXindex[0]]['PARAMS']['high'] - fxMod[useFXindex[0]]['PARAMS']['low'] ) * mod0 + fxMod[useFXindex[0]]['PARAMS']['low'] )
modName[0] = fxMod[useFXindex[0]]['NAME']
useFXlist[0]['PARAMETERS'][modName[0]]= modVal[0]
if fxMod2[usFXindex[0]['NAME'] != 'NONE' :
myMod2Val = ( (fxMod2[useFXindex[0]]['PARAMS']['high'] - fxMod2[useFXindex[0]]['PARAMS']['low'] ) * mod0 + fxMod2[useFXindex[0]]['PARAMS']['low']
myMod2Name = fxMod2[useFXindex[0]]['NAME']
useFXlist[0]['PARAMETERS'][myMod2Name]= myMod2Val
. (basically - i just typed that in so there might be a minor typo or formatting issue)
. fxActive[0] and fxActive[1] are just True/False values to let the system know if they need to update the values or not. i figure it saves a few CPU cycles to not keep updating an effect that isn't currently active.
. let me know if you have any questions
-james
(a nomad. )