Published
Edited
May 2, 2020
1 fork
27 stars
Insert cell
Insert cell
Insert cell
Insert cell
context = new (window.AudioContext || window.webkitAudioContext)();
Insert cell
// credits http://bl.ocks.org/aholachek/6e18a82c0f0ada144b854f788c07d7a4
createSound = (f, v) => {
var oscillator = context.createOscillator();
var gainNode = context.createGain();
gainNode.gain.value = v;
oscillator.type = 'triangle';
oscillator.frequency.value = f; // Hz
// Connect the oscillator to our speakers after passing it
// through the gainNode to modulate volume
oscillator.connect(gainNode);
gainNode.connect(context.destination);
// Start the oscillator now
oscillator.start();
// this rapidly ramps sound down
gainNode.gain.setTargetAtTime(0, context.currentTime, .03);
}
Insert cell
data2 = FileAttachment("selectedSeries2 (1)@2.json").json()
Insert cell
d3 = require("d3@5")
Insert cell
import {slider} from "@jashkenas/inputs"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more