Class Synth

Simple web audio synth of finite polyphony.

Hierarchy (view full)

Constructors

  • Parameters

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

          • msg: string

          Returns void

    Returns Synth

Properties

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

Type declaration

    • (msg): void
    • Parameters

      • msg: string

      Returns void

voiceParams?: VoiceBaseParams
voices: VoiceBase[]

Accessors

  • get maxPolyphony(): number
  • Returns number

  • set maxPolyphony(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Trigger panic and release all notes.

    Returns void

  • 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

  • Parameters

    • maxPolyphony: number

    Returns void