Aperiodic oscillator with an inharmonic frequency spectrum.

Hierarchy

Constructors

Properties

_gain: GainNode
context: BaseAudioContext
voices: OscillatorNode[]

Accessors

  • get channelCount(): number
  • Returns number

  • get channelCountMode(): ChannelCountMode
  • Returns ChannelCountMode

  • get channelInterpretation(): ChannelInterpretation
  • Returns ChannelInterpretation

  • get detune(): AudioParam
  • An a-rate AudioParam representing detuning of oscillation in cents (though the AudioParam returned is read-only, the value it represents is not). The default value is 0.

    Returns AudioParam

  • get frequency(): AudioParam
  • An a-rate AudioParam representing the frequency of oscillation in hertz (though the AudioParam returned is read-only, the value it represents is not). The default value is 440 Hz (a standard middle-A note).

    Returns AudioParam

  • get numberOfInputs(): number
  • Returns number

  • get numberOfOutputs(): number
  • Returns number

  • get numberOfVoices(): number
  • Get the number of voices in this MultiOscillator group.

    Returns number

  • set numberOfVoices(newValue): void
  • Set the number of voices in this MultiOscillator group. Allocates and auto-connects new voices as necessary.

    Parameters

    • newValue: number

    Returns void

  • get onended(): null | ((this, ev) => any)
  • Returns null | ((this, ev) => any)

  • get type(): OscillatorType
  • A string which specifies the shape of waveform to play; this can be one of a number of standard values, or "custom" to use a PeriodicWave to describe a custom waveform. Different waves will produce different tones. Standard values are "sine", "square", "sawtooth", "triangle" and "custom". The default is "sine".

    Returns OscillatorType

  • set type(newValue): void
  • A string which specifies the shape of waveform to play; this can be one of a number of standard values, or "custom" to use a PeriodicWave to describe a custom waveform. Different waves will produce different tones. Standard values are "sine", "square", "sawtooth", "triangle" and "custom". The default is "sine".

    Parameters

    • newValue: OscillatorType

    Returns void

Methods

  • Type Parameters

    • K extends "ended"

    Parameters

    • type: K
    • listener: ((this, ev) => any)
        • (this, ev): any
        • Parameters

          • this: OscillatorNode
          • ev: AudioScheduledSourceNodeEventMap[K]

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • destinationNode: AudioNode
    • Optional output: number
    • Optional input: number

    Returns AudioNode

  • Parameters

    • destinationParam: AudioParam
    • Optional output: number

    Returns void

  • Type Parameters

    • K extends "ended"

    Parameters

    • type: K
    • listener: ((this, ev) => any)
        • (this, ev): any
        • Parameters

          • this: OscillatorNode
          • ev: AudioScheduledSourceNodeEventMap[K]

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Sets a PeriodicWave which describes a periodic waveform to be used instead of one of the standard waveforms; calling this sets the type to "custom".

    Parameters

    • wave: PeriodicWave

      A PeriodicWave object representing the waveform to use as the shape of the oscillator's output.

    Returns void

  • Specifies the exact time to start playing the tone.

    Parameters

    • Optional when: number

      The time, in seconds, at which the sound should begin to play. This value is specified in the same time coordinate system as the AudioContext is using for its currentTime attribute. A value of 0 (or omitting the when parameter entirely) causes the sound to start playback immediately.

    Returns void

  • Specifies the time to stop playing the tone.

    Parameters

    • Optional when: number

      The time, in seconds, at which the sound should stop playing. This value is specified in the same time coordinate system as the AudioContext is using for its currentTime attribute. Omitting this parameter, specifying a value of 0, or passing a negative value causes the sound to stop playback immediately.

    Returns void

Generated using TypeDoc