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 No messages -odac -d ;;;RT audio out ; For Non-realtime ouput leave only the line below: ; -o wterrain.wav -W ;;; for file output any platform ; Required settings for WebAudio: sr = 48000 ksmps = 128 nchnls = 2 nchnls_i = 1 ; sr = 44100 ; ksmps = 32 ; nchnls = 2 0dbfs = 1 instr 1 kdclk linseg 0, 0.01, 1, p3-0.02, 1, 0.01, 0 kcx line 0.1, p3, 1.9 krx linseg 0.1, p3/2, 0.5, p3/2, 0.1 kpch line cpspch(p4), p3, p5 * cpspch(p4) a1 wterrain .5, kpch, kcx, kcx, -krx, krx, p6, p7 a1 dcblock a1 outs a1*kdclk, a1*kdclk endin f1 0 8192 10 1 0 0.33 0 0.2 0 0.14 0 0.11 f2 0 4096 10 1 i1 0 4 7.00 1 1 1 i1 4 4 6.07 1 1 2 i1 8 8 6.00 1 2 2 e