I'm trying to control the pitch of a simple oscil with the Razer Hydra motion controller through OSC. Here's my code:
<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
kr=441
instr 1
iin OSCinit 7022
krx init 0
kof OSClisten iin,"/sixense/hydra/0/controller/right/position/x","f",krx
aud oscil 0dbfs/20,krx,1
out aud
endin
</CsInstruments>
i 1 0 999
</CsScore>
</CsoundSynthesizer>
Here's the error I get in the console:
INIT ERROR in instr 1: Invalid ftable no. 1.000000
aud oscil.kk #i0 krx 1 0
B 0.000 - note deleted. i1 had 1 init errors
Looking at the FLOSS manual, I thought this would work. What am I doing wrong here? Thank you for your help.



Quickie answer...
[... as I just happened to log in a few minutes after your post!]
I don't know your controller, and have never (yet) played with OSC, but I think your problem is a lot simpler than that. I don't see you defining that table anywhere!
You need to either use an 'f' statement at the head of your score, or an 'ftgen' opcode in the orchestra, to tell the system what data the table should contain (the waveform that oscil is going to produce).
You probably just want a sine wave, so look at GEN10 in the manual. The 'f' statement in the example at the bottom of the page should be fine for what you want.
Thanks for your quick answer
Thanks for your quick answer. I would hope there was a simpler solution. It wouldn't take two lines to run one oscillator if the pitch were an i-variable. Is there an oscil opcode without the ftgen requirement? If not, Csound sure sucks.
I bit the bullet and used
I bit the bullet and used the f statement. Thanks. I created a new topic for my next difficulty.