Provides factories for building simple prefabricated synthesizers. Importantly, these are not the only way to generate audio with syngen. Implementations can build their own synthesizers or use any external library that supports connecting to its audio graph.
- Source:
Methods
(static) createAdditive(optionsopt) → {syngen.audio.synth~Synth}
Creates an additive synthesizer which wraps configurable harmonics into a unified synth.
Each harmonic is calculated from an individual frequency coefficient, gain multiplier, and detune modifier.
With ConstantSourceNode
s their values are controllable in unison such that they maintain their relationships.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
Returns:
(static) createAm(optionsopt) → {syngen.audio.synth~Synth}
Creates a synthesizer with amplitude modulation.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
- To Do:
-
- Leverage
syngen.audio.synth.createLfo
internally
- Leverage
Returns:
(static) createAmBuffer(optionsopt) → {syngen.audio.synth~Synth}
Creates a synthesizer which applies amplitude modulation to an AudioBufferSourceNode
.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
- To Do:
-
- Leverage
syngen.audio.synth.createLfo
internally
- Leverage
Returns:
(static) createBuffer(optionsopt) → {syngen.audio.synth~Synth}
Creates a synthesizer which uses an AudioBufferSourceNode
.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
Returns:
(static) createFm(optionsopt) → {syngen.audio.synth~Synth}
Creates a synthesizer with frequency modulation.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
- To Do:
-
- Leverage
syngen.audio.synth.createLfo
internally
- Leverage
Returns:
(static) createLfo(optionsopt) → {syngen.audio.synth~Synth}
Creates a simple low-frequency oscillator intended for modulation.
This is identical to createSimple()
except with different terminology.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
Returns:
(static) createMod(optionsopt) → {syngen.audio.synth~Synth}
Creates a synthesizer with both amplitude and frequency modulation.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
- To Do:
-
- Leverage
syngen.audio.synth.createLfo
internally
- Leverage
Returns:
(static) createPwm(optionsopt) → {syngen.audio.synth~Synth}
Creates a simple synthesizer with configurable pulse-width modulation.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
Returns:
(static) createSimple(optionsopt) → {syngen.audio.synth~Synth}
Creates a simple synthesizer with a single oscillator.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
{} |
Properties
|
- Source:
Returns:
Type Definitions
Plugin
A plugin compatible with synth chaining.
Typically returned from a syngen.audio.effect
or syngen.audio.formant
factory method.
Implementations can create their own plugins for synths as long as they have an input
and output
.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
input |
AudioNode | The plugin output. |
|
output |
AudioNode | The plugin output. |
|
param |
Object |
<optional> |
Hash of all |
stop |
function |
<optional> |
Stops the plugins. |
- Source:
- To Do:
-
- Improve documentation as an interface
Synth
A prefabricated synth returned from a syngen.audio.synth
factory method.
They wrap their AudioNode
s with an interface that exposes their AudioParam
s and provides methods to build more sophisticated circuits.
Internally they maintain a pointer to the last node before output so they can unlink them and dynamically add plugins to the output chain.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
assign |
function | Assigns |
chain |
function | Adds |
chainAssign |
function | Assigns and chains |
chainStop |
function | Ensures |
connect |
function | Connects synth output to |
disconnect |
function | Disconnects synth output from |
filtered |
function | Adds a |
output |
GainNode | The final output after all chained plugins. |
param |
Object | Hash of all |
shaped |
function | Adds a |
stop |
function | Stops the synth and all chained plugins. |
- Source:
- To Do:
-
- Improve documentation as an interface