Hierarchy

  • Oscillator

Constructors

  • Oscillator class for generating and modifying signals

    Parameters

    • type: DSP

      A waveform constant (eg. DSP.SINE)

    • frequency: number

      Initial frequency of the signal

    • amplitude: number

      Initial amplitude of the signal

    • bufferSize: number

      Size of the sample buffer to generate

    • sampleRate: number

      The sample rate of the signal

    Returns Oscillator

Properties

amplitude: number
bufferSize: number
cyclesPerSample: number
envelope?: ADSR
frameCount: number
frequency: number
func: ((step: number) => number)

Type declaration

    • (step: number): number
    • Parameters

      • step: number

      Returns number

sampleRate: number
signal: Float64Array
waveTable: Float64Array
waveTableLength: number

Methods

  • Parameters

    • step: number

    Returns number

  • Parameters

    • step: number

    Returns number

  • Parameters

    • step: number

    Returns 1 | -1

  • Parameters

    • step: number

    Returns number

  • Parameters

    • oscillator: {
          signal: number[];
      }
      • signal: number[]

    Returns Float64Array

  • Parameters

    Returns void

  • Parameters

    • signal: number[]

    Returns Float64Array

  • Returns void

  • Returns Float64Array

  • Set the amplitude of the signal

    Parameters

    • amplitude: number

      The amplitude of the signal (between 0 and 1)

    Returns void

  • Set the frequency of the signal

    Parameters

    • frequency: number

      The frequency of the signal

    Returns void

  • Parameters

    • offset: number

    Returns number

Generated using TypeDoc