Animation below 1 second

Hi everybody!
I do not know if it is the best place, but here is my question.

I am doing a watchface and I would like 10 pictures to be animated. I used this code (in opacitiy):

for picture 1: $(#Ds#%10)=0.0?100:0$
for picture 2: $(#Ds#%10)=1.0?100:0$

etc. until the 10th picture.
It works great! every second, my picture is changing (doing a 10 sec. animation).
My problem is as follow:
I would like to have for example 3 or 5 images per second (10 images / 2 or 3 seconds).
How could I do that?

Thank you by advance.

Matthieu

Use #Dsm# and a different divider.

Thank you! Can I ask you what is the divider in my code line?

I would say that it is remaining after division.

Be carefully with that!
It’s not listed as official Facer match operator http://docs.facer.io/expressions
so it might not always work.

This is it’s fully working version of (#Ds#%10) :
(((#Ds#/10)-(floor(#Ds#/10)))*10)
This works for 100%.

Personally I like using #DWFSS# (smooth rotation for seconds).
It increments by 6 every second and gives more than the integer values.

Dear CnP,
Thanks, could you give me 2 lines for 2 frames in exemple?

I’m really sorry Mellin, but it didn’t work.
(it’s probably me, as I’m not a professional).
As I ask to CnP, could you please give me an exemple for two frames please?

@CnP_Times #DWFSS# increments by 6 every second , but #Dsm# increments by 1000 every second. It’s way more precise.

@matthieu So you want a photo that will be visible for 0,33333 - 0,2 seconds (3-5 images per second). It would look like this:
For 1 image visible for 0,2 specific seconds in all minutes (ratio for 5 images per second):

$#Dsm#>=1&&#Dsm#<=1.2?100:0$

for an image to be visible between 1 and 1.2 seconds of every minute.

$#Dsm#>=1&&#Dsm#<=1.2&&#Dm#=30?100:0$

for an image to be visible between 1 and 1.2 seconds of minute 30 of every hour.

$#Dsm#>=1&&#Dsm#<=1.2&&#Dm#=30&&#DH#=18?100:0$

for an image to be visible between 1 and 1.2 seconds of minute 30 of hour 18.

1 Like

dear Mellin,

Thank you for your help.
So, I tried this (actually it’s my goal):

for an image to be visible between 0 and 0.2 seconds of every 2 seconds:

$#Dsm#>=0.0&&#Dsm#<=0.2&&#Dsm#=2.000?100:0$

Since I’ve got 10 images of 0.2 sec., it should do a total of animation of 2 sec. And I would like to make it repeat every 2 seconds (like a gif). I’ve done that:

Image 1:
$#Dsm#>=0.0&&#Dsm#<=0.2&&#Ds#=2.0?100:0$

Image 2:
$#Dsm#>=0.2&&#Dsm#<=0.4&&#Ds#=2.0?100:0$

Image 3:
$#Dsm#>=0.4&&#Dsm#<=0.6&&#Ds#=2.0?100:0$

but it doesn’t work… my pictures doesn’t even appear.
I’m desperate to understand why!!!

Can you explain it to me please?

 Image 1: 
 $#Dsm#>=0.0&&#Dsm#<=0.2&&#Ds#=2.0?100:0$

Why doesn’t it work?
You contradict yourself:
You ask it to give back 100 when:
seconds are greater than 0 AND smaller than 0.2 AND equal to 2…
It is impossible - that’s probably why it gives you back always 0.

Also, I think I misunderstood you.
You want this effect:
Visible from 12:20:59:57.0 to 12:20:59:57.2 and from 12:20:59:59.0 to 12:20:59:59.2 and from 12:21:00:01.0 to 12:21:00:01.2 and so on and so on. Right?

It would look like this:

$(((#Ds#/2)-floor(#Ds#/2))*2)>=0.0&&(((#Ds#/2)-floor(#Ds#/2))*2)<=0.2?100:0$

and here is how you edit it:
all those 2’s inside (not the 0.2) need to stay the same number (eg. all should be 4, or all should be 6), that number determinates period in which you want your cycle to repeat [in seconds].
Also, make sure that 60 (number of seconds in 1 minute) can be divided by your period without any leftovers.
0.0 and 0.2 are your range for visibility (make sure that both are equal or greater than 0 and both are smaller than your period.

.

And what is this?

(((#Ds#/2)-floor(#Ds#/2))*2)

In short: its calculating rest from a division of #Ds# by 2.
In long:
We take second and we want to get its rest from dividing it by 2.
We divide it, from that we subtract floor of that division (that function leaves only integer) and all of that multiply by that same 2.

Dear Mellin,
Yes it’s exactly what I want.
So I past the line:

$(((#Ds#/2)-floor(#Ds#/2))*2)>=0.0&&(((#Ds#/2)-floor(#Ds#/2))*2)<=0.2?100:0$

and modulated it for my ten frames, so the second was

$(((#Ds#/2)-floor(#Ds#/2))*2)>=0.2&&(((#Ds#/2)-floor(#Ds#/2))*2)<=0.4?100:0$

… and the last (10th picture) is:

$(((#Ds#/2)-floor(#Ds#/2))*2)>=1.8&&(((#Ds#/2)-floor(#Ds#/2))*2)<=2.0?100:0$

It is still all black. Is it because of my last line, with the 2.0?

(btw, thank you really much for your help)

1 Like

Mellin im creating something similar, can it last just 0.1 of a second? im trying to follow you guys here but definitely not being a programmer it has been more difficult for me, i even asked days off from work to study Facer… what im trying to do is this watch face… nerio alberto - Lumiere watch - watch face for Apple Watch, Samsung Gear S3, Huawei Watch, and more - Facer, so it looks more natural when the character blinks… i appreciate so much all the help you have given me…

To get a “more natural” animation, you would need a midframe (with like half closed eyes), maybe ever 2 or 3.

When you will have it let me know.

working on it, give me like 10 min or less

i have it in, what changes should i do in the formula?

Hi! Happy that this thread is useful for someone else. I’m not a programmer also, so I understand perfectly the difficulty.

1 Like

been following since you started it, i’m so intrigued to make it all well… this is what im trying to make, not as many of 10 frames per second, but if its needed to make it look more natural, will do…

And if you can do make it work for half second for example, please let me know, I’m still stuck with my problem (it’s a shame since Mellin gave me so much advises)

Ok, how many images do you have, how long they should be visible and when the animation should start?