memoscan
← all memos

Memo 0x7c09365f…5e9e76 on Ethereum

0x3d9456ad…fab4·#23,948,071·view on Etherscan
let ctx,leadOscs=[],bassOscs=[];`(Roconst LEAD_MIDI=`Roconst BASS_MIDI=`function m2f(m){return 440*Math.`Rppow(2,(m-69)/12)}`xfunction organ(f,oscs,master,amp`CRxconst g=ctx.createGain();`8g.gain.setValueAtTime(0,ctx.curr`~g.gain.linearRampToValueAtTime(a`Rwmp,ctx.currentTime+1.5);`@Rqg.connect(master);`pRw[1,2,3].forEach((r,i)=>{`@const o=ctx.createOscillator();Rxconst h=ctx.createGain();`8Ruo.frequency.value=f*r;`Ph.gain.value=[0.5,0.3,0.2][i];Rwo.connect(h).connect(g);`@Rloscs.push(o);`Rpfunction start(){`xRmif(ctx)return;`Rvctx=new AudioContext();`Hconst master=ctx.createGain();Rvmaster.gain.value=0.25;`Hmaster.connect(ctx.destination);aorgan(m2f(BASS_MIDI),bassOscs,maaif(LEAD_MIDI!==-1){organ(m2f(LEAaD_MIDI),leadOscs,master,0.4);}Rofunction stop(){`Rnif(!ctx)return;`leadOscs.forEach(o=>o.stop());bassOscs.forEach(o=>o.stop());ctx=null;leadOscs=[];bassOscs=[]afunction toggle(){if(!ctx)start(aRn);else stop();}`<!DOCTYPE html><html><head><meta` body{margin:0;padding:0;backgrou`Xnd:#000;display:flex;align-items`x:center;justify-content:center;m`in-height:100vh;cursor:pointer}img.rendered-svg{max-width:100%;`ׇmax-height:100vh;display:block}</style></head><body onclick="toa<img class="rendered-svg" src="" alt="Millennium Song notation"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef` ghijklmnopqrstuvwxyz0123456789+/`@