### Minimal NPM JavaScript Setup Source: https://surikov.github.io/webaudiofont/npm/src/docs/index.html Basic JavaScript setup for using WebAudioFont via NPM. This snippet shows how to require the library and instantiate the player. ```javascript var webaudiofont = require('webaudiofont'); var player = new WebAudioFontPlayer(); ``` -------------------------------- ### Hello, World Example Source: https://surikov.github.io/webaudiofont/npm/src/docs/index.html A minimal HTML page demonstrating how to initialize WebAudioFontPlayer, load an instrument, and play a single note. ```html

Hello, world!

``` -------------------------------- ### Initialize WebAudioFontReverberator Source: https://surikov.github.io/webaudiofont/npm/src/docs/classes/reverberator.WebAudioFontReverberator.html Demonstrates how to create a new instance of the WebAudioFontReverberator. This is the basic setup required before applying any reverberation effects. ```javascript const reverberator = new WebAudioFontReverberator(); ``` -------------------------------- ### Minimal NPM Installation for WebAudioFont Source: https://surikov.github.io/webaudiofont Shows the basic JavaScript and package.json configuration for using WebAudioFont via NPM. ```javascript var webaudiofont = require('webaudiofont'); var player = new WebAudioFontPlayer(); ``` ```json ... "devDependencies": { "webaudiofont":"^2.5.0" ... ``` -------------------------------- ### instrumentKeys Source: https://surikov.github.io/webaudiofont/npm/src/docs/classes/loader.WebAudioFontLoader.html Gets an array of all available instrument keys. ```APIDOC ## instrumentKeys ### Description Retrieves an array containing all the keys (identifiers) for the available instrument sounds. ### Returns - **string[]** - An array of strings representing the instrument keys. ``` -------------------------------- ### drumKeys Source: https://surikov.github.io/webaudiofont/npm/src/docs/classes/loader.WebAudioFontLoader.html Gets an array of all available drum keys. ```APIDOC ## drumKeys ### Description Retrieves an array containing all the keys (identifiers) for the available drum sounds. ### Returns - **string[]** - An array of strings representing the drum keys. ``` -------------------------------- ### startLoad Source: https://surikov.github.io/webaudiofont/npm/src/docs/classes/loader.WebAudioFontLoader.html Initiates the loading process for an audio font from a specified file path. ```APIDOC ## startLoad ### Description Starts the asynchronous loading of an audio font from a given file path. ### Parameters #### audioContext - **audioContext** (AudioContext) - The AudioContext to use for loading. #### filePath - **filePath** (string) - The path to the audio font file. #### variableName - **variableName** (string) - A name to associate with this loaded audio font. ### Returns - **void** ``` -------------------------------- ### drumTitles Source: https://surikov.github.io/webaudiofont/npm/src/docs/classes/loader.WebAudioFontLoader.html Gets an array of all available drum titles. ```APIDOC ## drumTitles ### Description Retrieves an array containing the display titles for all available drum sounds. ### Returns - **string[]** - An array of strings representing the drum titles. ``` -------------------------------- ### setupEnvelope Source: https://surikov.github.io/webaudiofont/npm/src/docs/classes/player.WebAudioFontPlayer.html Sets up an audio envelope with specified parameters. This method is used internally for configuring how notes are played. ```APIDOC ## setupEnvelope ### Description Sets up an audio envelope with specified parameters. This method is used internally for configuring how notes are played. ### Method setupEnvelope ### Parameters * **audioContext**: AudioContext - The Web Audio API AudioContext. * **envelope**: WaveEnvelope - The WaveEnvelope object to configure. * **zone**: WaveZone - The zone defining the sound characteristics for the envelope. * **volume**: number - The volume for the envelope. * **when**: number - The time at which the envelope should be set up. * **sampleDuration**: number - The duration of the audio sample. * **noteDuration**: number - The duration of the note. ### Returns void ```