Hacker News new | ask | show | jobs
by warenhor 2060 days ago
In case you want (like me) to share your best art with you colleagues:

let e = $.Event('keyup'); '09090586 '.split('').map((k, i) => {setTimeout(()=>{$.play(InstrumentPerKeyEnum[k],k,e.type==="keydown")}, i * 200); setTimeout(() => {$.play(InstrumentPerKeyEnum[k],k,e.type==="keyup")}, i * 250)});

3 comments

I think bongo cat needs a MIDI interpreter
let e = $.Event('keyup'); Math.PI.toFixed(50).split('').map((k, i) => {setTimeout(()=>{$.play(InstrumentPerKeyEnum[k],k,e.type==="keydown")}, i * 200); setTimeout(() => {$.play(InstrumentPerKeyEnum[k],k,e.type==="keyup")}, i * 250)});
It's not working in the console
Indeed, I forgot to define `e` on the same line, cheers.
Nice! the ending was fun :)