-
Variable frequency for a sinusoidal movement
Hi
I would like to simulate the butterfly flight with its chaotic changes. For this I wrote the following code into the Y Rotation of the left wing (the right one behaves the exact opposite way).
Freq_Min = thisComp.layer("Prarmètres généraux").effect("Freq_Min")("Curseur") ;
Freq_Max = thisComp.layer("Prarmètres généraux").effect("Freq_Max")("Curseur") ;Freq_Offset = Freq_Min ;
Freq_Delta = (Freq_Max - Freq_Min) / 2 ;Wiggle_Frequency = Freq_Offset + wiggle(1, Freq_Delta) + Freq_Delta ;
//Wiggle_Frequency ;
//Math.sin(10*time*2*Math.PI) ;
Math.sin(Wiggle_Frequency*time*2*Math.PI) ;
When I look the behaviour of this wing through the graphic view I notice that the frequency increases with time whereas I want the frequency to change along the wiggle value.1 – When I look at the graph of:
Wiggle_Frequency
the value oscilates randomly between 8.92 and 10.15
whereas I expected it to oscilate randomly between 9 and 102 – When I look at the graph of
Math.sin(10*time*2*Math.PI)
The frequency (10Hz) doesn’t change all along the timeline, everything behaves as expected.3 – Now if we use this “Wiggle_Frequency” as a changing frequency:
Math.sin(Wiggle_Frequency*time*2*Math.PI)
The graph of this third value shows clearly a sinwave which frequency changes but also inexorably increases along time
Whereas I expected this frequency not to increase more and more.Could someone please spot my mystakes?
I try to find some examples either on creativecow or somewhereelse but I’ve not found any case like this.Edit: Here is a screenshot that shows more about this strange behaviour:

in a sin function, when changing the frequency, the changing values are misinterprated by the script so the frequency “goes crazy” without any reason.