Math functions
“WTF is this ?!”
Let’s start by visualizing the first function we see in Deforum in the camera movment. that is good point to start from
Copy everything inside the brakets (don’t copy 0:)
The constant formula is the most important in my opinion because it allows you to control the strength schedule in a dynamic way.
This is the difference between amateur level of animations and top notch quality.
Upload your video in colab or locate it from your google drive (same as you did for the image)
Let me start just by saying that I had the worst grades ever in math. So if I figured this, then anyone can!
You can control specific parameters of Deforum with math functions like this.
I know it seems crazy but once you learn how to use them is gonna be easier then keyframing
Be carefull to commas, brakets, swaping the Xs for Ts, unwanted space bars between the numbers, when you transfer your formulas.
This is the part were most of the errors pop out in Deforum.
Hear the formula is decreasing its value from 3 to 0 in 120 frames.
Then from 120 frames to 240 back to an amplitude of 1
Complex functions
you can “mix” different functions
use “+” “-” “*” to summ, subtract, multiply
Paste the formula into a functions visualizer (there’s many on the internet, all for free)
I like to use this one: https://graphtoy.com/ because it allows you to see more functions at the same time
deleate evrything in the lines and paste your formula. THEN SWAP THE T with an X.
In this image, you can you can now visualize that the formula creates the shape of a sine wave.
THE RED DOT indicates the 0
and the axis from left to right represents the frames (yellow arrow)
the axis from down to up represents the amplitude of the value that the parameter where you use this formula is gonna have (green arrow)
Let me explain what these 3 numbers mean:
10 is the amplitude of the waveform / the value that your parameter is gonna reach
2 is the frequency of the waveform / the speed that your parameter will increase or decrease
10 is the frame rate of the waveform / after how many frames functions complete its cycle and start again
with this formula we are saying to the translation x to:
Go from 0 to 10 and back to 0 in 5 frames (positive cycle of the wavefrom)
Then, go from 0 to -10 and back to 0 in 5 frames for a total of 10 frames (negative cycle of the wavefrom)
Let’s have a look to
the formula to generate a sinewave (sin).
Another very important formula is the constant (cos).
Ultimately you can add more keyframes to your setting and get as crazy as you want!
Or keep the same amplitude from 0 to 118, drop it at 120 and slowly go back when you reach 240 frames
I really suggest to take your time and mess arround with graphtoy a bit, changing a number here and there yourself.
This is going to be probably the better way to learn how to use and tweak this functions
In this example, you can see how the function in yellow is nothing else that a constant function with a **69 modifier
The modifier value is going to change the “tightness” of the cycles, shaping them into this peaks.
Values of pair number should generate peaks only in one “direction” (up if the amplitude is posive or down for negative).
Values of dispair numbers should generate peaks in both “directions” like in the image
The function showed in green. It's the same function copied and pasted next to each other, I only changed the frame rate and the amplitude
I am telling: drop -0.1 out of 0.7 every 12 frames + drop -0.3 every 48 frames
At this point is just getting experimental, once you know that you can mix funcations toghter sky is the limit.
Get crazy creating your wacky functions!
This leads us to another point, which is:
here at The Dor Brothers we see ourselves more as creatives. We are not programmers, or a mathematical guy in this case, those people are the real Gods providing us mortals with the tools to create amazing animations.
at The Dor Brothers we are just passionate enough (or a bit crazy) to step into the unknown and then show you the creative way to use this tools. Honeslty, most of the stuff above i found it out myslef just by messing around with the values i showed. This is just to say that with enogh patience and the right mindset it’s just a matter of time