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.
--nosound ; Required settings for WebAudio: sr = 48000 ksmps = 128 nchnls = 2 nchnls_i = 1 /* Example for ntof: notename to frequency A notename is a string of the form [cents] Example notenames are: "4A" -> A in the 4th octave "5C+31" -> C5, 31 cents higher "4Db-13" -> D flat, 4th octave, 13 cents lower "7F#+" -> F# quarter tone higher "5G-" -> G5 a quarter tone lower NB: the frequency returned by ntof depends on the value of A4 */ A4 = 442 instr 1 ifreq ntof "4A" print ifreq koctave = 1 while (koctave <= 8) do Snote sprintfk "%dC", koctave kfreq ntof Snote printf "notename: %s freq: %.2f \n", koctave, Snote, kfreq koctave += 1 od turnoff endin i 1 0 1