Class: Synthesizer

Synthesizer(audioContext)

new Synthesizer(audioContext)

A basic synthesizer that can also serve as a parent class for other types of synthesizers.
Parameters:
Name Type Description
audioContext Object An AudioContext.
Author:
  • Lawrence Fyfe
Source:

Members

inputGain

Gets the input gain value.
Source:

inputGain

Sets the input gain to the specified value.
Source:

outputGain

Gets the output gain value.
Source:

outputGain

Sets the output gain to the specified value.
Source:

Methods

noteToFrequency(note) → {number}

Converts the specified note value to a frequency value.
Parameters:
Name Type Description
note number The note value.
Source:
Returns:
The frequency of the note.
Type
number

scheduleNote(note)

Schedules the specified note to be played according to its parameters.
Parameters:
Name Type Description
note Object The note to schedule.
Source:

startNote(note)

Starts playing the specified note immediately.
Parameters:
Name Type Description
note Object The note to play.
Source:

stopNote(note)

Stops playing the specified note immediately.
Parameters:
Name Type Description
note Object The note to stop.
Source:

stopScheduledNotes()

Stop all scheduled notes. This is mainly to stop scheduled notes that are currently playing.
Source:

velocityToGain(velocity) → {number}

Converts the specified velocity to a gain value by dividing the velocity by the maxmimum velocity (127 by default).
Parameters:
Name Type Description
velocity number The velocity.
Source:
Returns:
A gain value from 0-1.
Type
number