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 ; Audio out Audio in -odac -iadc ;;;RT audio I/O ; For Non-realtime ouput leave only the line below: ; -o abs.wav -W ;;; for file output any platform ; Required settings for WebAudio: sr = 48000 ksmps = 128 nchnls = 2 nchnls_i = 1 ; test instrument for pdclip opcode instr 3 idur = p3 iamp = p4 ifreq = p5 ifn = p6 kenv linseg 0, .05, 1.0, idur - .1, 1.0, .05, 0 aosc oscil 1.0, ifreq, ifn kmod expseg 0.00001, idur, 1.0 aout pdclip aosc, kmod, 0.0, 1.0 out kenv*aout*iamp endin f1 0 16385 10 1 f2 0 16385 10 1 .5 .3333 .25 .5 ; pdclipped sine wave i3 0 3 15000 440 1 i3 + 3 15000 330 1 i3 + 3 15000 220 1 s ; pdclipped composite wave i3 0 3 15000 440 2 i3 + 3 15000 330 2 i3 + 3 15000 220 2 e