Timbre.js

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

BooleanWrapper

Constant signal of 0 or 1

Constructor

bool = T("boolean", value=false);
bool = T(false);
        

Properties

bool.value; // [Boolean]
        

Methods

// Toggle true/false          
bool.bang();
        

Events

        

Example: Mute switch

bool  = T(true);
sin   = T("sin", 880, 0.25);
synth = T("*", bool, sin).play();


// push [bang] button to execute the below code
synth.onbang = function() {
    bool.bang();
};
        

Example: Two tones

bool = T(false);
bool.add = 660;
bool.mul = 220;
    
synth = T("fami", bool, 0.25).play();

// push [bang] button to execute the below code
synth.onbang = function() {
    bool.bang();
};
        

See Also:

T("number") T("array")