Class: notePlayer

notePlayer

A musical note that can be played in a browser. Plays for however long it has been defined to.

Constructor

new notePlayer(obj)

Parameters:
Name Type Description
obj Object properties needed to instanciate the class
Properties
Name Type Description
keynb Object corresponding number on a piano keyboard
freq Object sound frequency, in Hertz
octave Object musical octave the note belongs to [1-8]
name Object Full name of the note
Properties:
Name Type Description
pianoKeyNb number corresponding number on a piano keyboard
frequency number sound frequency, in Hertz
octave number musical octave the note belongs to [1-8]
name string Full name of the note
duration number length of time the sound has to be played, in seconds
volume number volume [0-1]
verbose Boolean verbose mode (true/false)
attack number time to ramp up to the desired volume [0-1]
release number time to ramp up from the desired volume to silence [0-1]
audioContext Object WebAudio audioContext
destinationNode Object WebAudio destinationNode
Author:
  • David B - laopunk
Source: