// Scale illusion — Deutsch: interleaved ascending/descending scales swap ears; listeners regroup by pitch. // Run: node examples/scale-illusion.js 200 261.63 8s // Run: node examples/scale-illusion.js tempo=200 root=C4 -d 8s // Keys: q quit import { AudioContext } from 'web-audio-api' import { init } from './graphs/scale-illusion.js' import { args, num, sec, keys, clearLine, help } from './utils.js' help({ description: 'interleave an ascending and descending scale between ears (Deutsch scale illusion)', usage: ['', '[tempo] [root] [duration]', 'tempo=200 root=C4 dur=8s'], options: [ ['tempo=', 'note tempo (default: 200)'], ['root=', 'root frequency (default: 261.63)'], ['-d, --duration