Public
Edited
Mar 4
7 forks
Insert cell
Insert cell
{
const url = await FileAttachment("blip.wav").url();
const sound = new Tone.Player(url).toDestination();
const play = () => sound.start();

await Tone.loaded;

const app = cm.render({
width: 100,
height: 100,
draw: [SVG.circle({ cx: 50, cy: 50, r: 50, onclick: play })]
});

return app.node();
}
Insert cell
SVG = cm.SVG
Insert cell
Tone = require("tone")
Insert cell
cm = require("charmingjs@0.0.12")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more