Optionaloptions: Partial<OmniOscillatorOptions>ReadonlycontextThe context belonging to the node.
Set this debug flag to log all events that happen in this class.
ReadonlydetuneThe detune value in cents (100th of a semitone).
ReadonlyfrequencyThe frequency value of the oscillator
Sources have no inputs
ReadonlynameThe name of the class
The callback to invoke when the source is stopped.
The output node
The volume of the output in decibels.
StaticversionThe version number semver
The base type of the oscillator.
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.
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.
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".
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
The modulationFrequency Signal of the oscillator when sourceType === "pwm" see PWMOscillator
The type of the modulator oscillator. Only if the oscillator is set to "am" or "fm" types.
'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. A square wave wave is composed of only odd harmonics up through the harmonic series. Partial count can limit the number of harmonics which are used to generate the waveform.
'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. A square wave wave is composed of only odd harmonics up through the harmonic series. Partial count can limit the number of harmonics which are used to generate the waveform.
The value is an empty array when the type is not "custom". This is not available on "pwm" and "pulse" oscillator types.
The partials describes the relative amplitude of each of the harmonics of the oscillator. The first value in the array is the first harmonic (i.e. the fundamental frequency), the second harmonic is an octave up, the third harmonic is an octave and a fifth, etc. The resulting oscillator output is composed of a sine tone at the relative amplitude at each of the harmonic intervals.
Setting this value will automatically set the type to "custom". The value is an empty array when the type is not "custom".
The phase is the starting position within the oscillator's cycle. For example a phase of 180 would start halfway through the oscillator's cycle.
The duration in seconds of one sample.
Returns the playback state of the source, either "started" or "stopped".
The type of the oscillator. Can be any of the basic types: sine, square, triangle, sawtooth. Or prefix the basic types with "fm", "am", or "fat" to use the FMOscillator, AMOscillator or FatOscillator types. The oscillator could also be set to "pwm" or "pulse". All of the parameters of the oscillator's class are accessible when the oscillator is set to that type, but throws an error when it's not.
Returns an array of values which represents the waveform.
The length of the waveform to return
Connect the output of this node to the rest of the nodes in series.
const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/handdrum-loop.mp3");
player.autostart = true;
const filter = new Tone.AutoFilter(4).start();
const distortion = new Tone.Distortion(0.5);
// connect the player to the filter, distortion and then to the master output
player.chain(filter, distortion, Tone.Destination);
connect the output of a ToneAudioNode to an AudioParam, AudioNode, or ToneAudioNode
The output to connect to
The output to connect from
The input to connect to
disconnect the output
Optionaldestination: InputNodeClean up.
connect the output of this node to the rest of the nodes in parallel.
const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/conga-rhythm.mp3");
player.autostart = true;
const pitchShift = new Tone.PitchShift(4).toDestination();
const filter = new Tone.Filter("G5").toDestination();
// connect a node to the pitch shift and filter in parallel
player.fan(pitchShift, filter);
Get the object's attributes.
Set multiple properties at once with an object.
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.
Convert the incoming time to seconds. This is calculated against the current TransportInstance bpm
Staticget
OmniOscillator aggregates all of the oscillator types into one.
Example