NoSleepCreative Wiki
  • Welcome to NoSleepCreative
  • After Effects
    • Getting Started with Expressions
    • Expressions & Snippets
      • JSX Cheatsheet
      • Expression Troubleshooting
      • Utilities
      • Shape & Mask
      • Type & Text
    • Cookbook
      • Algorithmic
      • Random properties
      • Harmonic Motion
      • Staggering
      • Tessellation & Tiling
      • Type animators
      • Speed lines
      • Radial Array
      • Orb & Trails
      • Shading & Texturing
      • Responsive
      • Automation
      • Setup & Rigs
    • Getting started with Scripting
    • Scripting
      • Utilities
      • Master Properties
    • ScriptUI
  • Studio Ops
    • Tooling
    • Toolkitting
    • Knowledge Base
    • Naming Convention
    • DAM
  • Cinema 4D
    • Formulas
    • Python Cheat Sheet
      • For Artists
      • Maya Environment
      • Maya snippets
      • VSFX 705
    • Cookbook
  • Info
    • About
    • Portfolio
    • Course
    • YouTube
    • Gumroad
    • GitHub
  • Dev
    • archive
      • Webscraping
      • Google Sheets Formulas
      • SQL
      • Terminal
      • C++
      • Unreal Engine
      • Concert Visualization
      • Dome-projection
      • UI UX
      • Professional Etiquettes
      • Woes
      • How to get better
        • Portfolio / Showreel
        • Design with cooking
      • Media theories
        • Post Cinematic Affect
        • Marxism, Reproduction and Aura
        • Heuristics & Authorship
        • 02 Semiotics
        • 3 Process?
        • 05
        • 06 Technology & Mediation
        • Formalism
        • Simulation
        • The Gaze & Media Critique
        • Import
        • 10-12
      • Recommended books
        • 🔴Things I learned
      • Mac Superuser
        • Applescript
      • InDesign
      • Illustrator
      • Blender
      • Premiere Pro
      • Mathematics
        • Probability
        • Linear Algebra
      • Shader Dev
      • Getting Started with After Effects
        • Best Practices
        • Pimping up AE
        • Environment
      • Houdini
        • Cheatsheet
        • Cookbook
        • Techniques
        • Dynamic
        • Rendering & Lighting
        • Animation
        • Particles
        • Others
          • Modeling
          • Fluids - Pyro & Smoke
          • Rendering
      • REGEX
    • Sandbox
      • Nexrender
        • Terminology
        • Project Files Preparation
Powered by GitBook
On this page
  • Abstract
  • Oscillations
  • Terminology
  • Sine wave
  • Cosine wave
  • Practical applications
  • Creating sine wave loops with varying frequency
  • Why generate paths with expressions
  • Amplitude modulation
  • Frequency increasing
  • Fractions & for-loop in createPath
  • Damped Sine Wave

Was this helpful?

  1. After Effects
  2. Cookbook

Harmonic Motion

Written on Mar 10, 2021. Last updated on ... — WIP

PreviousRandom propertiesNextStaggering

Last updated 3 years ago

Was this helpful?

Abstract

Harmonic oscillations or sine waves are commonly observed in the trends of Motion Design (as of 2021). It seems Mathematics or Trigonometry plays a significant role in art and design. This page will served to inform Motion Designers how the Math behind sine wave works and how you can use it in animation, or use to generate waves paths or shapes

Why does it matter?

For those who are allergic or have distaste for Mathematics or Trigonometry, I like you to refresh your understandings of how we can use these concepts to:

  1. Make complex animations that may be impossible or tedious to do manually

  2. See animation in terms of data and numbers. When I see animations like this, I do not see keyframes, but rather a sine wave being modulated to create a wavy motion [insert animation ref].

Readings

  • , Evan Abrams

  • , w3schools

  • , mathsisfun

  • , jjgifford

Text

  1. Ordinary Folk

  2. iLLo,

  3. Flatwhite Motion

  4. Gunner

Oscillations

Terminology

  • Crest — maximum value of upward displacement within a cycle

  • Trough — minimum or lowest point in a cycle.

  • Cycle — An oscillation, or cycle, is defined as a single change from up to down to up, or as a change from positive, to negative to positive.

  • Wave Length: the distance between two successive crests (period)or troughs of a wave.

  • Wave Height: the vertical distance between the trough of a wave and the following crest

  • Amplitude — the height from the center line to the peak (or to the trough). Or we can measure the height from highest to lowest points and divide that by 2.

  • Frequency — the number of occurrences of a repeating event per unit of times

  • Phase —the location or timing of a point within a wave cycle of a repetitive waveform.

  • Phase shift — how far the function is shifted horizontally from the usual position.

  • Radian — a unit of measure for angles that is based on the radius of a circle. A circle has 360° or 2pi radians.

Sine wave

A∗Math.sin(θ+C)A*Math.sin(\theta + C)A∗Math.sin(θ+C)
  • amplitude is A

  • phase is theta

  • phase shift is C

Why do we do append "Math." before sin?

Cosine wave

Practical applications

Creating sine wave loops with varying frequency

  • If you are creating a looping animation with a series of sine wave with varying frequencies, you have to determine the duration of the composition, or vice versa.

  • If your waves include frequencies of 1, .5, .2. Your composition duration should be 5s or multiple of 5s, because the slowest frequency is .2. For that wave to finish one cycle, it takes 1 second / 0.2 = 5 seconds.

  • Hence, it's a game of multiplication and time tables. For more complex variations such as frequency values of 0.3, 0.4, 0.5, you will have to find a common denominator (.333,2.5,2) = 10s .

Why generate paths with expressions

  • My main concerns is aliasing issues, by using shape layers, we avoid jagged edges that are present when you use wave warp effect with a high wave height.

Amplitude modulation

Frequency increasing

Fractions & for-loop in createPath

In order to generate a smooth wavy line, we have to generate many points sticking close together to maintain curvature. This is because we do not want to be concerned with writing a function to calculate the in and out tangents.

Damped Sine Wave

S = effect("Speed")("Slider");
A = effect("Amp")("Slider"); 
F = effect("Freq")("Slider") / 3.6;
R = effect("Resolution")("Slider");
W = effect("Width")("Slider");
E = effect("Exp")("Slider") * 100;

P = [];

for (i = 0; i < R; i++) {
    x = W / R * i * Math.exp(i / E)
    y = i * Math.exp(i / E) * Math.sin((time - inPoint) * S + i / (R / F)) * A;
    P.push([x, y]);
}

createPath(P, [], [], false)

This is because when we are writing expressions, we are using the Javascript language of a Math object to perform mathematical tasks on numbers. Some examples you may have seen include Math.cos, Math.round, or Math.ceil . You can learn more about it at .

Source: , Ordinary Folk

https://www.motionscript.com/mastering-expressions/simulation-basics-1.html
Math.sin
JS Math
Periodic functions
Harmonic
w3schools
An Ordinary Christmas work files