Timbre.js

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

PercussiveEnvelope

Control signal generator which outputs shaped decay envelopes.

Constructor

perc = T("perc", r=200, reversed=false, ended=NOP);

// r     [Number]   Release time in msec
// ended [Function] Script to be run when the envelope status reach the end

// Other constructors
T("perc", [table], release);
T("perc", [table], attack, release);
T("perc", [table], delay, attack, release);
T("perc", [table], delay, attack, release, attack-level);
        

Properties

perc.delay  // [Number] Delay time in msec
perc.a      // [Number] Attack time in msec
perc.r      // [Number] Release time in msec

perc.al     // [Number] Attack Level

adsr.reversed    // [Boolean] Reverse envelope

perc.currentTime // [Readonly] Current position in msec of the envelope
adsr.status      // [Readonly] The status of envelope
        

Methods

// Trigger the envelope
perc.bang();
        

Events

// Script to be run when the envelope status reach 'A'
adsr.onA;


// Script to be run when the envelope status reach 'R'
adsr.onR;


// Script to be run when the envelope status reach the end
perc.onended;
        

See Also:

T("adsr")