[FreeJ] JS question

dyne.org open discussions
Author: Vincent.CH
Date:  
To: FreeJ mailinglist
Subject: [FreeJ] JS question
Well, same day, other question...

I'll make a little performance with Freej in June , in south of France,
provence, during a festival , then i try to script some nice things ...
In the script below, i randomize the parameters values for Distort0r
effect filter
For those who are not aware, i'm a kind of newbie in js
But i like the effect made by this code on my image, except one
thing...: It goes really too fast !!, i'd love it to change parameters
values slower than this , it wd be smoother , nicer (to me).
So , if any of you can comment it, show me the direction...or another
way ...((o:
Damn , it's not so easy to understand how to insert some time parameters
in JS!
Vincent

// freej 0.9.1
//bad script for randomize parameters effect
//on an image

set_resolution(800,600);

ima = new ImageLayer()
ima.open("/path/to/image/o.jpg");
effa = new Filter("Distort0r");
add_layer(ima);
ima.add_filter(effa);

running = true;
kbd = new KeyboardController();
register_controller( kbd );
kbd.released_esc = function() { running = false; }
kbd.pressed_esc = function() {quit();}

function randomize_eff(effa) {
var a, f;
a = rand() % 50;
f = rand() % 50;


if(a<0) a = -a;
if(f<0) f = -f;

effa.set_parameter("Amplitude",a/100);effa.set_parameter("Frequency",f/10);

}
while(running) {

randomize_eff(effa);


run(1);

}
//quit();