{
const urls = [
await FileAttachment("blip.wav").url(),
await FileAttachment("pink.wav").url(),
await FileAttachment("takerimba.wav").url(),
await FileAttachment("tears.wav").url()
];
const sounds = urls.map((url) => new Tone.Player(url).toDestination());
const click = () => sounds[0].start();
const [, dispose] = cm
.flow()
.on("keydown", (_, { key }) => {
if (key === "a") sounds[1].start();
else if (key === "s") sounds[2].start();
else if (key === "d") sounds[3].start();
else if (key === "f") sounds[0].start();
})
.join();
await Tone.loaded;
invalidation.then(() => dispose());
return svg.svg({ width: 100, height: 100 }, [
svg.circle({ cx: 50, cy: 50, r: 50, onclick: click })
]);
}