Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SoundFontPlayer

A NoteSequence player based on Tone.js that uses SoundFont samples. The loadSamples method may be called before start so that the samples necessary for playing the sequence will be loaded and playing will begin immediately upon start.

Example (explicitly loading samples):

player.loadSamples(seq).then(() => player.start(seq))

Explicitly loads samples, so that playing starts immediately when start is called.

Example (implicitly loading samples):

player.start(seq)

If the samples for seq have not already been loaded, playing will only start after all necessary samples have been loaded.

Hierarchy

Index

Constructors

constructor

  • new SoundFontPlayer(soundFontURL: string, output?: any, programOutputs?: Map<number, any>, drumOutputs?: Map<number, any>): SoundFontPlayer

Properties

Protected callbackObject

callbackObject: BasePlayerCallback

Protected currentPart

currentPart: any

Protected playClick

playClick: boolean

Protected scheduledStop

scheduledStop: number

Methods

isPlaying

  • isPlaying(): boolean

loadSamples

  • loadSamples(seq: INoteSequence): Promise<void>

Protected playNote

  • playNote(time: number, note: INote): void

start

  • start(seq: INoteSequence, qpm?: number): Promise<void>

stop

  • stop(): void

Generated using TypeDoc