Ease

Easing and tweening classes for scserver and sclang. Ported from the Cinder C++ framework - original equations by Robert Penner

a Quark for SuperCollider

install it from within supercollider with the command Quarks.install("Ease") and then recompile.

Ease

Easing and tweening classes for scserver and sclang. Ported from the Cinder C++ framework - original equations by Robert Penner

NOTE: All these expects an input 0-1 as first argument to .value. If you give it out-of-range values the behaviour is undefined.

supercollider EaseGallery.new;

overview

Classes

  • EaseNone - simple linear tweening with no easing

Quadratic

  • EaseInQuad - quadratic (t^2) ease-in, accelerating from zero velocity
  • EaseOutQuad - quadratic (t^2) ease-out, decelerating to zero velocity
  • EaseInOutQuad - quadratic (t^2) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInQuad - quadratic (t^2) ease-out/in, decelerating until halfway, then accelerating

Cubic

  • EaseInCubic - cubic (t^3) ease-in, accelerating from zero velocity
  • EaseOutCubic - cubic (t^3) ease-out, decelerating to zero velocity
  • EaseInOutCubic - cubic (t^3) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInCubic - cubic (t^3) ease-out/in, decelerating until halfway, then accelerating

Quartic

  • EaseInQuart - quartic (t^4) ease-in, accelerating from zero velocity
  • EaseOutQuart - quartic (t^4) ease-out, decelerating to zero velocity
  • EaseInOutQuart - quartic (t^4) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInQuart - quartic (t^4) ease-out/in, decelerating until halfway, then accelerating

Quintic

  • EaseInQuint - quintic (t^5) ease-in, accelerating from zero velocity
  • EaseOutQuint - quintic (t^5) ease-out, decelerating to zero velocity
  • EaseInOutQuint - quintic (t^5) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInQuint - quintic (t^5) ease-out/in, decelerating until halfway, then accelerating

Sine

  • EaseInSine - sinusoidal (sin(t)) ease-in, accelerating from zero velocity
  • EaseOutSine - sinusoidal (sin(t)) ease-out, decelerating from zero velocity
  • EaseInOutSine - sinusoidal (sin(t)) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInSine - sinusoidal (sin(t)) ease-out/in, decelerating until halfway, then accelerating

Exponential

  • EaseInExpo - exponential (2^t) ease-in, accelerating from zero velocity
  • EaseOutExpo - exponential (2^t) ease-out, decelerating from zero velocity
  • EaseInOutExpo - exponential (2^t) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInExpo - exponential (2^t) ease-out/in, decelerating until halfway, then accelerating

Circular

  • EaseInCirc - circular (sqrt(1-t^2)) ease-in, accelerating from zero velocity
  • EaseOutCirc - circular (sqrt(1-t^2)) ease-out, decelerating from zero velocity
  • EaseInOutCirc - circular (sqrt(1-t^2)) ease-in/out, accelerating until halfway, then decelerating
  • EaseOutInCirc - circular (sqrt(1-t^2)) ease-out/in, decelerating until halfway, then accelerating

Bounce

  • EaseInBounce(a) - bounce (exponentially decaying parabolic bounce) ease-in, accelerating from zero velocity. the \a parameter controls overshoot, the default producing a 10% overshoot
  • EaseOutBounce(a) - bounce (exponentially decaying parabolic bounce) ease-out, decelerating from zero velocity. the \a parameter controls overshoot, the default producing a 10% overshoot
  • EaseInOutBounce(a) - bounce (exponentially decaying parabolic bounce) ease-in/out, accelerating until halfway, then decelerating. the \a parameter controls overshoot, the default producing a 10% overshoot
  • EaseOutInBounce(a) - bounce (exponentially decaying parabolic bounce) ease-out/in, decelerating until halfway, then accelerating. the \a parameter controls overshoot, the default producing a 10% overshoot

Back

  • EaseInBack(a) - back (overshooting cubic easing: (a+1)t^3 - at^2) ease-in, accelerating from zero velocity. the \a parameter controls overshoot, the default producing a 10% overshoot
  • EaseOutBack(a) - back (overshooting cubic easing: (a+1)t^3 - at^2) ease-out, decelerating from zero velocity. the \a parameter controls overshoot, the default producing a 10% overshoot
  • EaseInOutBack(a) - back (overshooting cubic easing: (a+1)t^3 - at^2) ease-in/out, accelerating until halfway, then decelerating. the \a parameter controls overshoot, the default producing a 10% overshoot
  • EaseOutInBack(a) - back (overshooting cubic easing: (a+1)t^3 - at^2) ease-out/in, decelerating until halfway, then accelerating. the \a parameter controls overshoot, the default producing a 10% overshoot

Elastic

  • EaseInElastic(a, p) - elastic (exponentially decaying sine wave) ease-in, accelerating from zero velocity. the \a parameter is amplitude and \p is period.
  • EaseOutElastic(a, p) - elastic (exponentially decaying sine wave) ease-out, decelerating from zero velocity. the \a parameter is amplitude and \p is period.
  • EaseInOutElastic(a, p) - elastic (exponentially decaying sine wave) ease-in/out, accelerating until halfway, then decelerating. the \a parameter is amplitude and \p is period.
  • EaseOutInElastic(a, p) - elastic (exponentially decaying sine wave) ease-out/in, decelerating until halfway, then accelerating. the \a parameter is amplitude and \p is period.

Atan

  • EaseInAtan(a) - atan ease-in, accelerating from zero velocity. the \a parameter is curvature.
  • EaseOutAtan(a) - atan ease-out, decelerating from zero velocity. the \a parameter is curvature.
  • EaseInOutAtan(a) - atan ease-in/out, accelerating until halfway, then decelerating. the \a parameter is curvature.

basic usage

```supercollider e= EaseInAtan(15); e.value(0) //0 at the start e.value(0.5) //what is the value in the middle of the curve e.value(1) //1 at the end

//this can also be written like this to save us from storing the ease object in a variable EaseInAtan.value(0.5)

//or shorter EaseInAtan.(0.5)

//to set the curvature you give a second argument EaseInAtan.(0.5, 10)

//or in the other notation e= EaseInAtan(10) e.value(0.5)

//-- a= (0..100)/100; //a linear ramp with values 0.0 - 1.0 a.collect{|t| EaseInQuad.(t)}.plot; a.collect{|t| EaseOutQuad.(t)}.plot; a.collect{|t| EaseInOutQuad.(t)}.plot;

//--similar in sclang and inside synthdefs s.boot c= {SinOsc.ar(EaseInOutExpo.kr(MouseX.kr)*500+500, 0, 0.1)}.play c.free a.collect{|x| EaseInOutExpo.(x)}.plot

//--rates are flexibe when used inside synthdefs c= {SinOsc.ar(EaseInAtan.(SinOsc.kr(1)).linlin(0, 1, 500, 5000), 0, 0.1)}.play //becomes kr c.free c= {SinOsc.ar(EaseInAtan.kr(SinOsc.ar(1)).linlin(0, 1, 500, 5000), 0, 0.1)}.play //kr with ar arg c.free c= {SinOsc.ar(EaseInAtan.ar(SinOsc.kr(1)).linlin(0, 1, 500, 5000), 0, 0.1)}.play //ar with kr arg c.free

//--nesting a= (0..100)/100; //a linear ramp with values 0.0 - 1.0 a.collect{|t| EaseInAtan.(EaseInAtan.(t))}.plot

//--creating an object style a= (0..100)/100; //a linear ramp with values 0.0 - 1.0 e= EaseInAtan(3); f= EaseInAtan(30); a.collect{|t| [e.(t), f.(t)]}.flop.plot

//even this works... e.(a).plot

//--use mouse to test s.boot c= {SinOsc.ar(EaseInOutQuint.ar(LFSaw.ar(MouseX.kr(1, 9, 1)).range(0, 1)).linexp(0, 1, 400, 800), 0, 0.1)}.play c.free c= {SinOsc.ar(EaseOutInExpo.ar(LFSaw.ar(MouseX.kr(1, 9, 1)).range(0, 1)).linexp(0, 1, 400, 800), 0, 0.1)}.play c.free c= {SinOsc.ar(EaseInAtan.ar(LFSaw.ar(MouseX.kr(1, 9, 1)).range(0, 1)).linexp(0, 1, 400, 800), 0, 0.1)}.play c.free c= {SinOsc.ar(EaseOutInElastic.ar(LFSaw.ar(MouseX.kr(1, 9, 1)).range(0, 1), MouseY.kr(1, 9, 1)).linexp(0, 1, 400, 800), 0, 0.1)}.play c.free c= {SinOsc.ar(EaseInBounce.ar(LFSaw.ar(MouseX.kr(1, 9, 1)).range(0, 1), MouseY.kr(1, 9, 1)).linexp(0, 1, 400, 800), 0, 0.1)}.play c.free ```

Ease
Project
Source file
Extension
Superclass:
EaseAtan
Project
Source file
Extension
Superclass:
Ease
EaseBack
Project
Source file
Extension
Superclass:
Ease
EaseBounce
Project
Source file
Extension
Superclass:
Ease
EaseElastic
Project
Source file
Extension
Superclass:
Ease
EaseGallery
Project
Source file
Extension
Superclass:
EaseInAtan
Project
Source file
Extension
Superclass:
EaseAtan
EaseInBack
Project
Source file
Extension
Superclass:
EaseBack
EaseInBounce
Project
Source file
Extension
Superclass:
EaseBounce
EaseInCirc
Project
Source file
Extension
Superclass:
Ease
EaseInCubic
Project
Source file
Extension
Superclass:
Ease
EaseInElastic
Project
Source file
Extension
Superclass:
EaseElastic
EaseInExpo
Project
Source file
Extension
Superclass:
Ease
EaseInOutAtan
Project
Source file
Extension
Superclass:
EaseAtan
EaseInOutBack
Project
Source file
Extension
Superclass:
EaseBack
EaseInOutBounce
Project
Source file
Extension
Superclass:
EaseBounce
EaseInOutCirc
Project
Source file
Extension
Superclass:
Ease
EaseInOutCubic
Project
Source file
Extension
Superclass:
Ease
EaseInOutElastic
Project
Source file
Extension
Superclass:
EaseElastic
EaseInOutExpo
Project
Source file
Extension
Superclass:
Ease
EaseInOutQuad
Project
Source file
Extension
Superclass:
Ease
EaseInOutQuart
Project
Source file
Extension
Superclass:
Ease
EaseInOutQuint
Project
Source file
Extension
Superclass:
Ease
EaseInOutSine
Project
Source file
Extension
Superclass:
Ease
EaseInQuad
Project
Source file
Extension
Superclass:
Ease
EaseInQuart
Project
Source file
Extension
Superclass:
Ease
EaseInQuint
Project
Source file
Extension
Superclass:
Ease
EaseInSine
Project
Source file
Extension
Superclass:
Ease
EaseNone
Project
Source file
Extension
Superclass:
Ease
EaseOutAtan
Project
Source file
Extension
Superclass:
EaseAtan
EaseOutBack
Project
Source file
Extension
Superclass:
EaseBack
EaseOutBounce
Project
Source file
Extension
Superclass:
EaseBounce
EaseOutCirc
Project
Source file
Extension
Superclass:
Ease
EaseOutCubic
Project
Source file
Extension
Superclass:
Ease
EaseOutElastic
Project
Source file
Extension
Superclass:
EaseElastic
EaseOutExpo
Project
Source file
Extension
Superclass:
Ease
EaseOutInBack
Project
Source file
Extension
Superclass:
EaseBack
EaseOutInBounce
Project
Source file
Extension
Superclass:
EaseBounce
EaseOutInCirc
Project
Source file
Extension
Superclass:
Ease
EaseOutInCubic
Project
Source file
Extension
Superclass:
Ease
EaseOutInElastic
Project
Source file
Extension
Superclass:
EaseElastic
EaseOutInExpo
Project
Source file
Extension
Superclass:
Ease
EaseOutInQuad
Project
Source file
Extension
Superclass:
Ease
EaseOutInQuart
Project
Source file
Extension
Superclass:
Ease
EaseOutInQuint
Project
Source file
Extension
Superclass:
Ease
EaseOutInSine
Project
Source file
Extension
Superclass:
Ease
EaseOutQuad
Project
Source file
Extension
Superclass:
Ease
EaseOutQuart
Project
Source file
Extension
Superclass:
Ease
EaseOutQuint
Project
Source file
Extension
Superclass:
Ease
EaseOutSine
Project
Source file
Extension
Superclass:
Ease

Found no versions tagged via git

Installation

Repository

URL

https://github.com/redFrik/Ease

Since

2011-12-08

Last update

2022-11-22

Current version

1.03

Quark info

url

https://www.fredrikolofsson.com/

name

Ease

path

Ease

since

2011

author

redFrik

schelp

EaseGallery

summary

Easing and tweening classes for scserver and sclang. Ported from the Cinder C++ framework - original equations by Robert Penner

version

1.03

isCompatible

a function

Possible dependcies

Possible dependants