Cabbage Logo
Back to Cabbage Site

Csound with Oculus Interaction SDK

Hi :slight_smile:

I am trying to implement the new Oculus Interaction SDK in Unity with Csound. Oculus provides a Pose Detection tool that recognizes a pose and activates a function. I am trying to use a thumbs up to turn on Csound by dragging the CsoundUnity script into Selector Unity Event Wrapper. Some of the functions from CsoundUnity do show up, and I selected SendScoreEvent to see if it turns on.

I basically just use the example C# script for Csound initialization.

But apparently, it did not work as expected. I wonder if anyone has tried this before or is able to help me out :)) The example script for Pose Detection from Oculus worked pretty well. A thumbs-up can do PlayAudio() that triggers an audio sample.

Hopefully someone is down to help out and explore this with me! Thank you so much XD

I never tried this, but just to be sure: are you specifying the score to send in the text field?
Otherwise it should work!

Yes there is a field popped up for me to type in the score. But it does not work as expected.

Also wondering if I can do SetChannel here. The drop-down menu doesn’t have this function.

Thanks again for your support!

Remove the " " then it should work!

Amazing it worked :rofl:

I am also trying to send an event that stops the instrument. You suggested once to send “i-1 0 -1” OnCollisionExit, which I assume could stop Csound from running, so this is what I specified for another pose

I guess I am wrong with it, as it did not stop. Do you have any idea?

Thank you XD

It’s because you’re starting the instrument to last for 10 seconds. To be able to stop an instrument you should start it with indefinite duration (i1 0 -1) so you will be able to stop it with i-1 0 -1

1 Like

That’s right. You can also send a value to a named channel with finite duration, and use it to trigger a turnoff, i.e,

kKillSwitch chnget "kill"
if changed(kKillSwitch) ==  1 then
1 Like

Worked perfectly! Thanks a million! Here is a little progress.

My next step would be mapping the position, rotation, and finger distance of my hands to do pitches and continuous control. It is weird that the new SDK does not update Vector 3 in Editor, which prevents me from GetComponent to chnget the variables. Waiting for the Oculus community to help!

Thanks again for the amazing support!

That is a good approach. I will definitely try this out! Thank you :DDD

Hey @chenliu52, this looks and sounds really great. Keep those updates coming!

1 Like