Page 1 of 1

Edit Filter with a Module

Posted: Thu Jun 21, 2012 4:14 pm
by Spjoni
Hello Everybody

I want to connect the LB-SmoothChanges Module to the Radius from the FilterEffect HoleDistortion.
For the reason, that the Hole grows smooth... I trigger the HoleRadius with OSC and this is to jumpy. If i will set the smoother between... that would work, but i dont know if this is possible...

Can anyone tell me, if a can Connect a Filter with a Filter/Module?

Thank you so much!
Spjoni

Re: Edit Filter with a Module

Posted: Sat Jun 23, 2012 8:35 pm
by The Midi Thief
Nope. You have to code your own module or alter the code of the LB-SmoothChanges Module to connect to the FilterEffect HoleDistortion. It's probably just a few lines of code but there are other people here that have dealt with the filters more that probably can give you a better reply.

Re: Edit Filter with a Module

Posted: Sun Jun 24, 2012 7:47 pm
by anomad
. i've worked w/some filer effects in modules (120 avFX) so maybe i can offer some insight...

. as i understand the effects system, you basically update the effect information, clear the filters, then push the changed effects into the filters...

. so, you want to use : {'FILTER': '(CI) Hole Distortion', 'PARAMETERS': {'Center Y': 0.5, 'Center X': 0.5, 'Radius': 0.0}}

. quick sidebar - how did I know the definition? i edit the 'Filter (layer)' module and have it print out the effects being used...

. in the 'Filters (layer)' module, in Init() towards the bottom - uncomment the '##print filters' line and Cmd-Option-O to see the output

Code: Select all

def setFilters(): filters = [{},{},{},{}] for i in range(0,4): if enabledPass[i]: filters[i] = filtersPass[i] modul8.setFilters(filters, 0, postFilters) ##print filters <------- uncomment this line! # Last initializations
. i would suggest re-commenting that line once you get the definitions so you don't waste resources printing stuff out.

. ok, so now you have a dictionary item of your effect...

. in Init()

Code: Select all

myFx = {'FILTER': '(CI) Hole Distortion', 'PARAMETERS': {'Center Y': 0.5, 'Center X': 0.5, 'Radius': 0.0}}
. somewhere in your code, you want to assign the variable that is doing the smoothing to the myFx['PARAMETERS']['Radius']

. then in PeriodicalEvent() something like

Code: Select all

myFx['PARAMETERS']['Radius'] = varThatIsSmoothing modul8.setFilters([{}],0,False) modul8.setFilters(myFx,0,False)
. good luck! :)

-james
(a nomad. )