Hello all
In preparation for the CSoundConf next month, I am dipping my toes back (after a 26 year hiatus!) - I really welcome the global variables and OSC support… but when I connect the two, it seems I’m getting clogging (MacOS, terminal or Cabbage, same result)
I am certain it is my error, so here I am, asking for help
if you have an osc controller that generates values for x and y, this should work smoothly, no?
any pointers welcome!
<CsoundSynthesizer>
<CsOptions>
-m 128
-odac
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 64
nchnls = 2
0dbfs = 1
giNbBands init 40
gaSum init 0
gaIn init 0
gklow init 15
gkhigh init 131
gkwidth init (131 - 15) / giNbBands
giPort OSCinit 7773
; test sines summing
instr voice
asin poscil 0.1, mtof((p4 * gkwidth) + gklow)
gaSum = gaSum + asin
endin
instr input
kx[] init 10
ky[] init 10
nxtmsg:
kk1, kx OSClisten giPort, "/sb3/mb/x", "ffffffffff"
kk2, ky OSClisten giPort, "/sb3/mb/y", "ffffffffff"
if ((kk1 == 0) && (kk2 == 0)) goto ex
gklow scale kx[1], ftom(400), ftom(20), 1, 0
gkhigh scale ky[1], ftom(16000), ftom(800), 1, 0
gkwidth = (gkhigh - gklow) / giNbBands
; printk 0.04, gklow
kgoto nxtmsg
ex:
endin
instr output
outs gaSum, gaSum
clear gaSum
endin
instr test
iBandID = 0
schedule("input", 0, p3)
loop:
schedule("voice", 0, p3, iBandID)
loop_lt iBandID, 1, giNbBands, loop
schedule("output", 0, p3)
endin
schedule("test",0,10000)
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>