This should play if your Web browser has WebAssembly enabled (most do). Most examples will play unless they need to load files. The first time you click Play, Csound will spend a few seconds loading, then play. You can edit this code and replay it.
; Select audio/midi flags here according to platform -odac -+rtmidi=virtual -M0 ;;;realtime audio out and virtual midi keyboard ;-iadc ;;;uncomment -iadc if realtime audio input is needed too ; Required settings for WebAudio: sr = 48000 ksmps = 128 nchnls = 2 nchnls_i = 1 ;after a UDO from Rory Walsh ; sr = 44100 ; ksmps = 32 ; nchnls = 2 instr 1 ;displays notes, midi channel and control number information kstatus, kchan, kdata1, kdata2 midiin k1 changed kstatus k2 changed kchan k3 changed kdata1 k4 changed kdata2 if((k1==1)||(k2==1)||(k3==1)||(k4==1)) then printks "Value:%d ChanNo:%d CtrlNo:%d\n" , 0, kdata2, kchan, kdata1 endif endin i1 0 60 ;print values for 60 seconds e