Octave illusion

Swap two antiphase frequencies between ears so a single tone seems to jump register and side.

npx web-audio-api octave-illusion 400 800 2 12s
low=<hz|note>
frequency or note name in the CLI (default: 400)
high=<hz|note>
frequency or note name in the CLI (default: 800)
rate=<hz>
alternation rate
-d, --duration <time>
run time (CLI accepts s/m/h suffixes; default: 12s)
ready

This renders Deutsch's octave illusion: two antiphase frequencies swap between ears so a single tone seems to jump register and side, an effect that only works over headphones. Hear it in the browser, or render the stereo signal from the Node CLI to study or share it.