Channel
class Component ↳ extends ToneAudioNode<ChannelOptions>
Channel provides a channel strip interface with volume, pan, solo and mute controls.
// pan the incoming signal left and drop the volume 12db const channel = new Tone.Channel(-0.25, -12);
Constructor
Section titled “Constructor”new Channel(volume?: number, pan?: number)Parameters
-
volume
numberoptionalThe output volume.
-
pan
numberoptionalthe initial pan
new Channel(options?: Partial<ChannelOptions>)Parameters
- options
Partial<ChannelOptions>optional
Properties
Section titled “Properties”read-only
input: InputNodeThe input node or nodes. If the object is a source, it does not have any input and this.input is undefined.
output
Section titled “output”read-only
output: OutputNodeThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
read-only
pan: Param<"audioRange">The L/R panning control. -1 = hard left, 1 = hard right.
Range: -1 to 1
read-only
muted: booleanIf the current instance is muted, i.e. another instance is soloed, or the channel is muted
solo: booleanMethods
Section titled “Methods”receive()
Section titled “receive()”receive(name: string): thisReceive audio from a channel which was connected with send.
Parameters
-
name
stringThe channel name to receive audio from.
Returns this
send()
Section titled “send()”send(name: string, volume?: number): Gain<"decibels">Send audio to another channel using a string. send is a lot like
connect, except it uses a string instead of an object. This can
be useful in large applications to decouple sections since send
and receive can be invoked separately in order to connect an object
Parameters
-
name
stringThe channel name to send the audio
-
volume
numberoptional default0The amount of the signal to send. Defaults to 0db, i.e. send the entire signal
Returns Gain<"decibels"> Returns the gain node of this connection.
getDefaults()
Section titled “getDefaults()”static
getDefaults(): ChannelOptionsReturns all of the default options belonging to the class.
Returns ChannelOptions
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), connect(), disconnect(), fan(), toDestination(), toMaster()