JSFiddle - React, Tailwind, and code Playground

by teropa

Babel + JSX

let audioCtx = new AudioContext();

let osc = audioCtx.createOscillator();

osc.frequency.value = 440;
osc.frequency.setValueAtTime(440 * Math.pow(2, 1/12), audioCtx.currentTime + 1);
osc.frequency.setValueAtTime(440 * Math.pow(2, 2/12), audioCtx.currentTime + 2);

osc.connect(audioCtx.destination);
osc.start();
osc.stop(audioCtx.currentTime + 3);