Ditty Mario 🍄

Oh yeah! Mario time!

Log in to post a comment.

ditty.bpm = 90;
const interval = 1/2; // left ear; 5/4 for major third, 6/5 for minor third
const tune = synth.def((phase, env, tick) => [Math.sin(phase * interval * Math.PI * 2) * env.value, Math.cos(phase * Math.PI * 2) * env.value], {name: 'tune', env: adsr2});
loop(() => {
    [
      e7, e7, 0, e7, 0, c7, e7, 0, g7, 0, 0,  0, g6, 0, 0, 0,
      c7, 0, 0, g6, 0, 0, e6, 0, 0, a6, 0, b6, 0, as6, a6, 0,
      g6, e7, g7, a7, 0, f7, g7, 0, e7, 0, c7, d7, b6, 0, 0,
      c7, 0, 0, g6, 0, 0, e6, 0, 0, a6, 0, b6, 0, as6, a6, 0,
      g6, e7, g7, a7, 0, f7, g7, 0, e7, 0, c7, d7, b6, 0, 0
    ].forEach((note,idx) => (note ? tune.play(note, { attack: 0.05, release: 0.15 + Math.random() * 0.35 }) : {}, sleep(0.25)));
    sleep(1.5);
});