Tone.Switch
↳ EXTENDS Tone.SignalBaseWhen the gate is set to 0, the input signal does not pass through to the output. If the gate is set to 1, the input signal passes through. the gate is initially closed.
CONSTRUCTOR
new Tone.Switch ( [open
]
)
open
If the gate is initially open or closed.
type:
Boolean
optional
EXAMPLE
var sigSwitch = new Tone.Switch();
var signal = new Tone.Signal(2).connect(sigSwitch);
//initially no output from sigSwitch
sigSwitch.gate.value = 1;
//open the switch and allow the signal through
//the output of sigSwitch is now 2. Members
∿
.gate
↝ Number #The control signal for the switch. When this value is 0, the input signal will NOT pass through, when it is high (1), the input signal will pass through.
Methods
.close ( )
#
time
The time when the switch will be closed.
type:
Time
default:
now
↪ returns
Tone.Switch
this
Close the switch at a specific time.
EXAMPLE
//close the switch a half second from now
sigSwitch.close("+0.5");.open ( )
#
time
The time when the switch will be open.
type:
Time
default:
now
↪ returns
Tone.Switch
this
Open the switch at a specific time.
EXAMPLE
//open the switch to let the signal through
sigSwitch.open();