Options
All
  • Public
  • Public/Protected
  • All
Menu

Multi-instrument SoundFont. Must be initialized and samples must be pre-loaded using the loadSamples method before any notes can be played.

Hierarchy

  • SoundFont

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

name

name: string

Methods

initialize

  • initialize(): Promise<void>
  • Loads SoundFont configuration from a soundfont.json file in the base URL directory. Does not load any of the samples.

    Returns Promise<void>

loadSamples

  • Load samples necessary to play a set of notes. This must be called before any notes can be played.

    Parameters

    Returns Promise<void>

playNote

  • playNote(pitch: number, velocity: number, startTime: number, duration: number, program: number, isDrum: boolean, output: any): void
  • Play a note using one of the sampled instruments.

    Parameters

    • pitch: number

      Pitch of the note.

    • velocity: number

      Velocity of the note.

    • startTime: number

      Time at which to start playing the note.

    • duration: number

      Length of the note in seconds.

    • program: number

      Program number to use for instrument lookup.

    • isDrum: boolean

      Drum status to use for instrument lookup.

    • output: any

      Output AudioNode.

    Returns void

Generated using TypeDoc