// Risset rhythm — infinitely accelerating or decelerating beat. // The rhythmic analog of the Shepard tone. // Run: node examples/risset-rhythm.js up 120 20s // Run: node examples/risset-rhythm.js dir=down bpm=90 -d 30s sound=wood // Run: node examples/risset-rhythm.js sample=kick.wav // Keys: q quit import { readFileSync } from 'node:fs' import { AudioContext } from 'web-audio-api' import { init } from './graphs/risset-rhythm.js' import { createInstrument } from './graphs/metronome.js' import { args, sec, keys, clearLine, help } from './utils.js' help({ description: 'play an endlessly accelerating or decelerating rhythm illusion', usage: ['', '[up|down] [bpm] [duration]', 'dir=down bpm=90 dur=30s sound=wood', 'sample=kick.wav'], options: [ ['dir=', 'movement direction (default: up)'], ['bpm=', 'center tempo (default: 120)'], ['-d, --duration