diff options
author | Richard <q@1bpm.net> | 2025-04-13 18:48:02 +0100 |
---|---|---|
committer | Richard <q@1bpm.net> | 2025-04-13 18:48:02 +0100 |
commit | 9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22 (patch) | |
tree | 291bd79ce340e67affa755a8a6b4f6a83cce93ea /site/app/base/interop_work.deprecated.csd | |
download | apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.gz apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.bz2 apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.zip |
initial
Diffstat (limited to 'site/app/base/interop_work.deprecated.csd')
-rw-r--r-- | site/app/base/interop_work.deprecated.csd | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/site/app/base/interop_work.deprecated.csd b/site/app/base/interop_work.deprecated.csd new file mode 100644 index 0000000..8a12b18 --- /dev/null +++ b/site/app/base/interop_work.deprecated.csd @@ -0,0 +1,108 @@ +<CsoundSynthesizer>
+<CsOptions>
+-odac
+</CsOptions>
+<CsInstruments>
+sr = 48000
+ksmps = 64
+nchnls = 2
+0dbfs = 1
+seed 0
+
+
+
+#include "sequencing_melodic_persistence.udo"
+
+opcode jsio_sendraw, 0, S
+ Smessage xin
+ prints "CBDT "
+ prints Smessage
+ prints "\n"
+endop
+
+
+gijsio_collections[][] init 20, 300
+
+opcode jsio_getcollection
+ Scollection, SonComplete xin
+
+endop
+
+
+instr jsio_loadcollection
+ Sdata = strget(p4)
+
+endin
+
+
+
+
+
+gSjsioBuffer[] init 16
+gijsioBufferMax = 0
+gijsioBufferLock = 0
+
+
+
+
+instr jsio_bufferadd
+ icbid = p4
+ Sstatus = strget(p5)
+ Sdetails = strget(p6)
+ if (gijsioBufferLock == 1) then
+ schedule(p1, 0.1, 1, icbid, Sstatus, Sdetails)
+ else
+ gijsioBufferLock = 1
+ Sitem = sprintf("{\"cbid\":%d", icbid)
+ if (strcmp(Sstatus, "") != 0) then
+ Sitem = strcat(Sitem, sprintf(",\"status\":\"%s\"", Sstatus))
+ endif
+
+ if (strcmp(Sdetails, "") != 0) then
+ Sitem = strcat(Sitem, sprintf(",\"details\":\"%s\"", Sdetails))
+ endif
+
+ gSjsioBuffer[gijsioBufferMax] = strcat(Sitem, "}")
+ gijsioBufferMax += 1
+
+ gijsioBufferLock = 0
+ endif
+ turnoff
+endin
+
+
+instr jsio_bufferflush
+ Schannel = strget(p4)
+
+ if (gijsioBufferLock == 1) then
+ schedule(p1, 0.1, 1, Schannel)
+ else
+ gijsioBufferLock = 1
+ if (gijsioBufferMax == 0) then
+ chnset "", Schannel
+ gijsioBufferLock = 0
+ else
+ index = 0
+ Soutput = "["
+ while (index < gijsioBufferMax) do
+ if (index > 0) then
+ Soutput = strcat(Soutput, ",")
+ endif
+ Soutput = strcat(Soutput, gSjsioBuffer[index])
+ index += 1
+ od
+ Soutput = strcat(Soutput, "]")
+ chnset Soutput, Schannel
+ gijsioBufferMax = 0
+ gijsioBufferLock = 0
+ endif
+ endif
+ turnoff
+endin
+
+
+</CsInstruments>
+<CsScore>
+i "jsio_bufferadd" 0 1
+</CsScore>
+</CsoundSynthesizer>
\ No newline at end of file |