Timbre.js

JavaScript Library for Objective Sound Programming
system requirements: Chrome 14- or Firefox 4-

Easing

Easing

Constructor

ease = T("ease", type="linear", duration=1000, start=0, stop=1, onchanged=NOP);

// type      [String / Function]
// duration  [Number]
// start     [Number]
// stop      [Number]
// onchanged [Function]


// NOTE:
// The Easing.Functions refered to https://github.com/sole/tween.js
//
// The curves visualized.
// http://sole.github.com/tween.js/examples/03_graphs.html
        

Properties

ease.type;        // [String / Function]
ease.duration;    // [Number]
ease.start;       // [Number]
ease.stop;        // [Number]
ease.delay;       // [Number] Delay time

ease.value;       // [Readonly] Current value
ease.currentTime; // [Readonly]
        

Methods

        

Events

// Script to be run when easing
ease.onchanged = function(value) {};


// Script to be run when has reach the end
ease.onended = function() {};
        

Example

ease  = T("ease", "bounce.out", 1500, 1320, 440);
synth = T("tri", ease, 0.5).play();

synth.onplay = function() { ease.bang(); };
synth.onbang = function() { ease.bang(); };
ease.delay = 1000;
        

See Also:

T("glide")