Class: Note

Note(target, noteParamsopt)

A musical note composed of one or more oscillators and an ADSR envelope.

Constructor

new Note(target, noteParamsopt)

Create a note
Parameters:
Name Type Attributes Description
target AudioContext | AudioNode output destination for audio
noteParams Object <optional>
options that affect the note as a whole
Properties
Name Type Attributes Default Description
attack number <optional>
0.02 attack time in seconds
decay number <optional>
0.02 decay time in seconds
release number <optional>
0.01 release time in seconds
sustain number <optional>
0.04 sustain level as proportion of peak level, 0 to 1 inclusive
triggerTime number <optional>
target.currentTime time to schedule the note (see AudioContext.currentTime)
velocity number <optional>
1 note velocity, 0 to 1 inclusive
Source:

Methods

releaseNote()

Trigger the release of the envelope
Source:

stopNote(timeopt)

Stop all oscillators
Parameters:
Name Type Attributes Default Description
time number <optional>
AudioContext.currentTime When to stop playing the notes.
Source: