@mohayonao/fm-synth

0.1.3 • Public • Published

FM SYNTH

Build Status NPM Version License

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->".

fm-synth

Algorithm Presets

4 operators algorithm

See Also

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @mohayonao/fm-synth

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • mohayonao