fs
@mohayonao/fm-synth
npm i @mohayonao/fm-synth
fs

@mohayonao/fm-synth

simple frequency modulation synthesizer

by mohayonao

0.1.3 (see all)License:MITTypeScript:Not Found
npm i @mohayonao/fm-synth
Readme

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

Downloads/wk

3

GitHub Stars

22

LAST COMMIT

7yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.1.3
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial