From d4701791a2d04ff52bea456ebb34f4d79819f97e Mon Sep 17 00:00:00 2001 From: Richard Knight Date: Tue, 9 Apr 2024 22:58:44 +0100 Subject: initial --- examples/post.csd | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/post.csd (limited to 'examples/post.csd') diff --git a/examples/post.csd b/examples/post.csd new file mode 100644 index 0000000..21535bd --- /dev/null +++ b/examples/post.csd @@ -0,0 +1,46 @@ + + +-odac + + +sr = 44100 +kr = 4410 +nchnls = 2 +0dbfs = 1 + +; basic oscillator to see how audio is affected +instr oscil + a1 oscil 0.1, 440 + outs a1, a1 +endin + + +; issue a POST request at init time and display the output +instr irate + prints "init time post: may cause audio dropout\n\n" + ires, Sres curlpost "http://csound.1bpm.net/_curl_plugin_example/post", "Hello from Csound" + print ires + prints Sres + prints "\n" + turnoff +endin + + +; issue a POST request at k-rate and display the output +instr krate + prints "k-rate threaded post: should not affect audio\n\n" + kdone, kres, Sres curlpostk "http://csound.1bpm.net/_curl_plugin_example/post", "Hello from Csound" + if (kdone == 1) then + printf "res %d ; %s\n", kdone, kres, Sres + turnoff + endif +endin + + + +i"oscil" 0 5 +i"irate" 1 1 +i"krate" 3 1 + + + -- cgit v1.2.3