FM synth

Use one oscillator to modulate another oscillator’s frequency.

npx web-audio-api fm-synthesis 440 2 5 3s
carrier=<hz|note>
frequency or note name in the CLI (default: 440)
ratio=<number>
modulator/carrier frequency ratio
index=<number>
modulation index
-d, --duration <time>
run time (CLI accepts s/m/h suffixes; default: 30s)
ready

This is an FM synthesis example: one oscillator modulates another oscillator frequency, and the carrier-to-modulator ratio and index shape the resulting timbre from bell-like to metallic. Try it in the browser, or render the same modulator-to-carrier graph from the Node CLI.