• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

clamp a wiggle expression

Participant ,
May 28, 2015 May 28, 2015

Copy link to clipboard

Copied

How do I go about clamping a wiggle expression?

I am using the mosaic effect with a wiggle expression on it. The only thing is that I never want the number to become 1, only 2 or higher as with 1 the mosaic effect make vertical lines that I don't want.

Cheers

TOPICS
Expressions

Views

5.4K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , May 28, 2015 May 28, 2015

You could use the linearize function to limit the numbers. You must remember that if you set wiggle to 3, 20 that the wiggle will happen 3 times per second and the value will be between -20 and 20. Also, since you're working with Mosaic you would probably want to round the number of columns. The expression would look like this:

t = wiggle(3, 20);

n = linear(t, -20, 20, 2, 10);

Math.round(n);

This would wiggle the horizontal or vertical block number between 2 and 10 three times a second.

Votes

Translate

Translate
Community Expert ,
May 28, 2015 May 28, 2015

Copy link to clipboard

Copied

You could use the linearize function to limit the numbers. You must remember that if you set wiggle to 3, 20 that the wiggle will happen 3 times per second and the value will be between -20 and 20. Also, since you're working with Mosaic you would probably want to round the number of columns. The expression would look like this:

t = wiggle(3, 20);

n = linear(t, -20, 20, 2, 10);

Math.round(n);

This would wiggle the horizontal or vertical block number between 2 and 10 three times a second.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2015 May 29, 2015

Copy link to clipboard

Copied

Thank you for your reply, this is great.

Thank You.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2015 May 28, 2015

Copy link to clipboard

Copied

Rick's linear is a good approach.

If you really just want to clamp you do it like this

var wiggleResult = wiggle(/*your parameters here */);

var clampedWiggleResult = Math.max(2,wiggleResult);

clampedWiggleResult

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2015 May 29, 2015

Copy link to clipboard

Copied

LATEST

Thank you also for your swift reply.

Cheers

Votes

Translate

Translate

Report

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