## Adobe Support Community

• Global community
• Language:
• Deutsch
• English
• Español
• Français
• Português
• 日本語コミュニティ
Dedicated community for Japanese speakers
• 한국 커뮤니티
Dedicated community for Korean speakers
Exit
• Random rotation that starts at and ends at the sam...

# Random rotation that starts at and ends at the same number - LOOP

Community Beginner ,
Apr 01, 2023 Apr 01, 2023

Copied

OK this is a definate Jedi Java expression. How do I take the random expression below that moves a meter on a meter and will end on the same rotation number so I can loop it.

//Smooth wiggle

freq = effect("Speed")("Slider");

amp = effect("Range")("Slider");

n = freq.numKeys;

if (n > 0 && freq.key(1).time < time){ accum = freq.key(1).value*(freq.key(1).time - inPoint);

for (i = 2; i <= n; i++){

if (freq.key(i).time > time) break; k1 = freq.key(i-1); k2 = freq.key(i); accum += (k1.value + k2.value)*(k2.time - k1.time)/2; } accum += (freq.value + freq.key(i-1).value)*(time - freq.key(i-1).time)/2; }

else{

accum = freq.value*(time - inPoint);

}

t = wiggle(1,amp,1,.5,accum); //Limit range to meter scale minimum and maximum

linear(t, -100, 100, -85, 89);

TOPICS
Expressions

Views

96

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more  1 Reply 1
LEGEND ,
Apr 02, 2023 Apr 02, 2023

Copied

LATEST

It would probably be a lot simpler to just animate the amplitude of the wiggle and animate the base value along with it to have fixed pinning points, then pre-compose and loop that with time-remapping. Same for simply convcerting the expression to keyframes.Due to how wiggle works you'd probably need to apply the two expressions to different controls, anyway. Even if one were to construct a second loop around your existing one it has no way of knowing what the actual output values are.

Mylenium   