Class WebAudioMidiOutChannel

Represents a single channel within the WebAudioMidiOut. This allows for creation of simple sine, square, triangle & sawtooth waves.

Hierarchy

  • WebAudioMidiOutChannel

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • audioContext: AudioContext

      The AudioContext instance which the synth channel is operating within.

    • type: any

      The type of waveform being produced, valid values are: 'sine', 'square', 'triangle', or 'sawtooth'.

    • gain: number = 0.1

      The amount of gain to be applied to the waveform. Default value is 0.1.

    Returns WebAudioMidiOutChannel

Properties

audioContext: AudioContext

The AudioContext instance which the synth channel is operating within.

type: any

The type of waveform being produced, valid values are: 'sine', 'square', 'triangle', or 'sawtooth'.

Accessors

  • get gain(): number
  • The numeric value of the amount of gain being applied to each note.

    Returns number

  • set gain(value: number): void
  • Parameters

    • value: number

    Returns void

  • get typeName(): string
  • Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.

    Returns string

Methods

  • This method gets called whenever a new note is to be played on the synth channel.

    It returns a new OscillatorNode instance.

    Parameters

    • frequency: number

      This is the frequency of the note being played.

    Returns OscillatorNode

Generated using TypeDoc