# Tone.AMOscillator

↳ EXTENDS Tone.Oscillator

Tone.AMOscillator

### CONSTRUCTOR

new Tone.AMOscillator (
frequency
,
type
,
modulationType
)
frequency

The starting frequency of the oscillator.

type:
type

The type of the carrier oscillator.

type:
modulationType

The type of the modulator oscillator.

type:

### DEFAULTS

{
frequency : 440 ,
detune : 0 ,
phase : 0 ,
type : sine ,
modulationType : square ,
harmonicity : 1
}

## Members

#### .baseType

#

The oscillator type without the partialsCount appended to the end

### EXAMPLE

#### .detune

#

The detune control signal.

#### .frequency

#

The oscillator’s frequency

#### .harmonicity

#

Harmonicity is the frequency ratio between the carrier and the modulator oscillators. A harmonicity of 1 gives both oscillators the same frequency. Harmonicity = 2 means a change of an octave.

### EXAMPLE

#### .modulationType

#

The type of the modulator oscillator

#### .partialCount

#

‘partialCount’ offers an alternative way to set the number of used partials. When partialCount is 0, the maximum number of partials are used when representing the waveform using the periodicWave. When ‘partials’ is set, this value is not settable, but equals the length of the partials array.

#### .partials

#

The partials of the carrier waveform. A partial represents the amplitude at a harmonic. The first harmonic is the fundamental frequency, the second is the octave and so on following the harmonic series. Setting this value will automatically set the type to “custom”. The value is an empty array when the type is not “custom”.

### EXAMPLE

#### .phase

#

The phase of the oscillator in degrees.

#### .type

#

The type of the carrier oscillator

inherited from Tone.AudioNode

#### .numberOfOutputs

The number of outputs coming out of the AudioNode.

inherited from Tone.AudioNode

#### .channelCount

channelCount is the number of channels used when up-mixing and down-mixing connections to any inputs to the node. The default value is 2 except for specific nodes where its value is specially determined.

inherited from Tone.AudioNode

#### .channelCountMode

channelCountMode determines how channels will be counted when up-mixing and down-mixing connections to any inputs to the node. The default value is “max”. This attribute has no effect for nodes with no inputs.

inherited from Tone.AudioNode

#### .channelInterpretation

channelInterpretation determines how individual channels will be treated when up-mixing and down-mixing connections to any inputs to the node. The default value is “speakers”.

inherited from Tone.AudioNode

#### .context

Get the audio context belonging to this instance.

inherited from Tone.AudioNode

#### .numberOfInputs

The number of inputs feeding into the AudioNode. For source nodes, this will be 0.

inherited from Tone.Source

#### .state

Returns the playback state of the source, either “started” or “stopped”.

inherited from Tone.Source

#

Mute the output.

### EXAMPLE

inherited from Tone.Source

#

The fadeOut time of the amplitude envelope.

inherited from Tone.Source

#### .volume

#

The volume of the output in decibels.

### EXAMPLE

inherited from Tone.Source

#

The fadeIn time of the amplitude envelope.

## Methods

#### .dispose ( )

#
↪ returns

this

Clean up.

inherited from Tone.AudioNode

#### .toMaster ( )

#
↪ returns

this

Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)

### EXAMPLE

inherited from Tone.AudioNode

#### .connect ( )

#
unit
type: or or
outputNum

optionally which output to connect from

type:
default: 0
inputNum

optionally which input to connect to

type:
default: 0
↪ returns

this

connect the output of a ToneNode to an AudioParam, AudioNode, or ToneNode

inherited from Tone.AudioNode

#### .disconnect ( )

#
output

Either the output index to disconnect if the output is an array, or the node to disconnect from.

type: or
↪ returns

this

disconnect the output

inherited from Tone.AudioNode

#### .fan ( )

#
nodes
type: or or
↪ returns

this

connect the output of this node to the rest of the nodes in parallel.

inherited from Tone.AudioNode

#### .chain ( )

#
nodes
type: or or
↪ returns

this

Connect the output of this node to the rest of the nodes in series.

### EXAMPLE

inherited from Tone.Oscillator

#### .unsyncFrequency ( )

#
↪ returns

this

Unsync the oscillator’s frequency from the Transport. See Tone.Oscillator.syncFrequency

inherited from Tone.Oscillator

#### .syncFrequency ( )

#
↪ returns

this

Sync the signal to the Transport’s bpm. Any changes to the transports bpm, will also affect the oscillators frequency.

### EXAMPLE

inherited from Tone.Source

#### .start ( )

#
time

When the source should be started.

type:
default: now
↪ returns

this

Start the source at the specified time. If no time is given, start the source now.

### EXAMPLE

inherited from Tone.Source

#### .stop ( )

#
time

When the source should be stopped.

type:
default: now
↪ returns

this

Stop the source at the specified time. If no time is given, stop the source now.

### EXAMPLE

inherited from Tone.Source

#### .unsync ( )

#
↪ returns

this

Unsync the source to the Transport. See Tone.Source.sync

inherited from Tone.Source

#### .sync ( )

#
↪ returns

this

Sync the source to the Transport so that all subsequent calls to `start` and `stop` are synced to the TransportTime instead of the AudioContext time.

### EXAMPLE

docs generated Sep 15 2019