So you don't care how readable your code is?
176 karma · joined September 16, 2016
There's nothing stopping you from writing imperative, side-effect heavy code. But it's something you deliberately opt into, usually on the edges of the program, rather than something you have to deal with by default. Absolutely nothing about React discourages this.
Plug a few oscillators into each other and you have an FM synth. Feed delays into each other, etc, etc. You can do that in a few lines of code with no dependencies.
To me, that's a huge potential audience.
If you want a array of samples and depend on dozens of JS libs for functionality, well, I'm sure the AudioWorkers will catch up eventually.
const audioContext = new AudioContext();
const osc = audioContext.createOscillator();
osc.frequency.value = 440;
osc.connect(audioContext.destination);
osc.start();
"BufferSourceNode" is intended to play back samples like a sampler would. The method the author proposes of creating buffers one after the other is a bizarre solution.