Skip to content

Instantly share code, notes, and snippets.

@arturparkhisenko
Last active January 11, 2021 16:47
Show Gist options
  • Save arturparkhisenko/55d3260a7639d1aeb793ee122c58b334 to your computer and use it in GitHub Desktop.
Save arturparkhisenko/55d3260a7639d1aeb793ee122c58b334 to your computer and use it in GitHub Desktop.
js fun
// https://twitter.com/MylesBorins/status/929414418680643585?s=09
const context = new window.AudioContext();
for (let i = 0; i < 10; i++) {
let osc = context.createOscillator();
osc.type = 'square';
osc.frequency.value = 40 + i * 0.1111;
osc.connect(context.destination);
osc.start();
}
// second part
const context = new window.AudioContext();
for (let i = 0; i < 100; i++) {
let osc = context.createOscillator();
osc.type = 'sawtooth';
osc.frequency.value = 40 + i * 0.0111;
osc.connect(context.destination);
osc.start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment