Skip to content

Instantly share code, notes, and snippets.

@mohayonao
Created June 26, 2017 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohayonao/1acede6fcc53add0fbbd986b21767669 to your computer and use it in GitHub Desktop.
Save mohayonao/1acede6fcc53add0fbbd986b21767669 to your computer and use it in GitHub Desktop.
import neume, { scapi } from "neume";
const neu = neume();
const { mul, SinOsc } = scapi;
const hello = neu.def("hello", () => {
const freq = ctl("freq");
SinOsc(freq)::mul(0.2);
});
let synth = { kill: () => {} };
setInterval(() => {
synth.kill();
const freq = (Math.random() * 2 - 1) * 220 + 880;
synth = hello(neu.currentTime. { freq });
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment