puls


pulse variation

puls

puls(id)dim(n)

        Builds object id type timer puls size n, a pitch signal (1 every n frame, elsewhere 0).
Note:
exec puls(id) incrementes the timer.
exec puls incrementes all timers.
In interaction anyflo mode the timers are automatically incremented.
Options:
dim(n1,n2): produces a stair signal: 0 on n1 frames, 1 on n2 frames.
dim(da)sin: produces a sinusoidal signal: sin(num*da), with num = frame number.

puls(id)

        Returns the signal value and incrementes it.

puls(x,y1,y2,p,phi,e)

        Returns y=y1+(y2-y1)*(1+(sin(2*PI*x/p+phi))^e)/2
Notes:
1) This function returns y varying sinusoidally between y1 and y2 with a period p, and a phase phi when x varies linearly.
2) If e is absent, the rise to power t is not performed (pure sinusoidal variation).
3) If e belongs to the interval ] 0,1[ the sinusoid is more "curved"
4) If e belongs to the interval ]1.4 [ the sinusoid is "tense"
5) If several vectors (y1,y2,p,phi,e) are defined, puls returns the average of the signals corresponding.
Example:
y1=-1;y2=1;p=2*PI;phi=PI/2;
for(x=0,5,.2){$puls(x,y1,y2,p,phi);NL;}

prints:
        1
        0.980067
        0.921061
        0.825336
        0.696707
        0.540302
        0.362358
        0.169967
        -0.029200
        -0.227202
        -0.416147
        -0.588501
        -0.737394
        -0.856889
        -0.942222
        -0.989993
        -0.998295
        -0.966798
        -0.896758
        -0.790967
        -0.653643
        -0.490261
        -0.307333
        -0.112153
        0.087499
        0.283662