FM SYNTH
simple frequency modulation synthesizer
Installation
Node.js
npm install @mohayonao/fm-synth
Browser
API
Operator
constructor(algorithm: number|string, operators: any[])
Instance attribute
context: AudioContext
operators: any[]
algorithm: string
onended: function
Instance methods
connect(destination: AudioNode): void
disconnect(): void
start(when: number): void
stop(when: number): void
Algorithm Notation
let A = audioContext.createDelay();
let B = new Operator(audioContext);
let C = new Operator(audioContext);
let D = new Operator(audioContext);
let fm = new FMSynth("E-D-C->; B-A->", [ A, B, C, D, 0 ]);
-
A
,B
,C
...Z
: index of the operators -
-
: connection (connects to a node's frequency or node self if not has frequency) -
>
: connection to output -
;
: separator -
0
in operators mean OFF. Those are ignored in the audio graph.
Now, the instance of FMSynth builds the below graph by the given algorithm "D-C->; B-A->"
.
Algorithm Presets
See Also
- @mohayonao/operator - simple operator
License
MIT