Skip to content
Tone.js

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);

See also: PanVol and Solo

new Channel(volume?: number, pan?: number)

Parameters

  • volume number optional

    The output volume.

  • pan number optional

    the initial pan

new Channel(options?: Partial<ChannelOptions>)

Parameters

read-only

input: InputNode

The input node or nodes. If the object is a source, it does not have any input and this.input is undefined.

read-only

name: string

The name of the class

Default: "Channel"

read-only

output: OutputNode

The 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

volume: Param<"decibels">

The volume control in decibels.

mute: boolean

Mute/unmute the volume

read-only

muted: boolean

If the current instance is muted, i.e. another instance is soloed, or the channel is muted

solo: boolean

Solo/unsolo the channel. Soloing is only relative to other Channels and Solo instances

dispose(): this

Dispose and disconnect

Returns this

receive(name: string): this

Receive audio from a channel which was connected with send.

Parameters

  • name string

    The channel name to receive audio from.

Returns this

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 string

    The channel name to send the audio

  • volume number optional default 0

    The 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.

static

getDefaults(): ChannelOptions

Returns all of the default options belonging to the class.

Returns ChannelOptions