Highlighted

## Matching Random Seed to the bpm of a song.

New Here ,
Sep 25, 2020

Copied

Hey Everybody,

I got a fairly straightforward question but my head hurts from trying to make it work.
So I want the random seed of a wiggle transform to go up exactly on beat with a song. I know the song is 140 bpm and I want the random seed to go up every other beat. 140/60=2.33/2=1.166666

So the random seed needs to go up by 1 every 1.1666 seconds.
I tried it with the time*1.1666 expression but this doesn't quite work because it will add 1.16666 every 1 second instead of the other way around. (I hope I am making sense)

Is there an expression I can use that will add 1 every 1.166666 seconds? Pretty much like a timer?

TOPICS
Expressions

Views

47

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

## Matching Random Seed to the bpm of a song.

New Here ,
Sep 25, 2020

Copied

Hey Everybody,

I got a fairly straightforward question but my head hurts from trying to make it work.
So I want the random seed of a wiggle transform to go up exactly on beat with a song. I know the song is 140 bpm and I want the random seed to go up every other beat. 140/60=2.33/2=1.166666

So the random seed needs to go up by 1 every 1.1666 seconds.
I tried it with the time*1.1666 expression but this doesn't quite work because it will add 1.16666 every 1 second instead of the other way around. (I hope I am making sense)

Is there an expression I can use that will add 1 every 1.166666 seconds? Pretty much like a timer?

TOPICS
Expressions

Views

48

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 25, 2020 0
3 Replies 3
New Here ,
Sep 25, 2020

Copied

Just as I posted this I am starting to think time*1.16666 totally works already and I was confusing myself by making things more complicated than they are.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 25, 2020 0
Sep 25, 2020

Copied

I'm not exactly sure what you want to do but I think you want to set random seed timeliness to true so the random seed value only changes every 1.16 seconds so that you get a random value that changes every 1.16 seconds. The value of the seed change has nothing to do with the random number that will be generated so increasing the seed value by 1 isn't the problem you are trying to solve, What you want to do is add some kind of value to a number every 1.16 seconds.

Time is a decimal value so time will have to be divided by 1.16 and then rounded. To be completely accurate time should be divided by 70 divided by 2. This is what your expression should look like if you wanted the random value to be something between 0 and 10 and change 70 times a minute.

``````seed = Math.floor(time / (70/60))
seedRandom(seed, timeless = true)
random(10)``````

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 25, 2020 0
LATEST
Sep 25, 2020

Copied

Alternatively, you could do one or two animations and use the loopOut() expression with the offset option.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 25, 2020 0
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects