simple frequency modulation synthesizer
Node.js
npm install @mohayonao/fm-synth
Browser
constructor(algorithm: number|string, operators: any[])
context: AudioContext
operators: any[]
algorithm: string
onended: function
connect(destination: AudioNode): void
disconnect(): void
start(when: number): void
stop(when: number): void
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;
: separator0
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->"
.
MIT
Version | Tag | Published |
---|---|---|
0.1.3 | latest | 7yrs ago |