Class UnisonSynth

Web audio synth of finite polyphony where the voices are stacked in unison.

Hierarchy (view full)

Constructors

  • Parameters

    • audioContext: BaseAudioContext
    • destination: AudioNode
    • Optional log: ((msg) => void)
        • (msg): void
        • Parameters

          • msg: string

          Returns void

    Returns UnisonSynth

Properties

audioContext: BaseAudioContext
destination: AudioNode
log: ((msg) => void)

Type declaration

    • (msg): void
    • Parameters

      • msg: string

      Returns void

voiceParams?: UnisonVoiceParams
voices: UnisonVoice[]

Accessors

  • get maxPolyphony(): number
  • Returns number

  • set maxPolyphony(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Start playing a note at the specified frequency and velocity.

    Parameters

    • frequency: number

      Frequency in Hertz.

    • velocity: number

      Voice amplitude. Recomended range from 0 to 1.

    Returns (() => void)

    A callback that stops playing the note.

      • (): void
      • Returns void