Cabbage Logo
Back to Cabbage Site

CsoundUnity Package (UPM) development

Now it works out of the box on Windows, MacOS, and Android 64 bit (so on Oculus Quest too)!
And I suppose iOS shouldn’t be too difficult if we use the right bundle :wink:
I’ll fix some of the existing samples, and then we can plan a release in the upcoming weeks.
What about the version of this? CsoundUnity is now at version 2.3, should we start again from 1 since it’s a (slightly) different implementation, or go with 3.0? What do you think?

I think 3 would be better. It’s a new major release with lots of improvements. I think if we went back to version 1 we would need to change its name?

Right, good point!
I’ll add some development notes in the description of the package :wink:

We could try to export for WebGL also! I’ll have a look :wink:

Is WebGL still supported? I thought they had dropped it completely?

I never worked with it but it seems to be supported. I’m reading it has lots of limitations, for example it doesn’t work on most mobile devices: it may work on high end devices :confused:
I’ll do some tests!

I’m not sure it’s such a good use of your time. I always get the impression it’s something they don’t have much love for!

I have to explore it for a job, so I’ll take it as an opportunity :wink:

1 Like

we discovered another Unity issue! we’re becoming famous!! :sweat_smile: vote for it!

Nice one! By the time you’re done they might offer you a job!

Yes possibly! But we have to release the package first!

And also the Android crash is a Unity issue now!

1 Like

You’re on a roll!

Ok one of the issues was fixed yesterday, now it doesn’t crash anymore when exiting playmode. It wasn’t Unity, it was my fault, :sweat_smile:
There were some fields missing from CSOUND_PARAM struct, so the memory was corrupting. Strange this crash doesn’t happen in older Unity versions.
I just copied the struct from csound6net, that’s not updated to the latest CSOUND_PARAM version which has 3 more fields.
So only one bug left, the android crash on ARM7! Hope the Unity guys will have good news soon :wink:

Oh yeah, I’m actually surprised this is the first time we got caught out with that! Richard’s csound6net is quite old at this stage :laughing:

old but gold!

1 Like

I am sorry to ask, perhaps the answer somewhere in this thread, but I didn’t find it. Did you have success with delegates? As I understand SenseEventsCallback() do this kind of job.
I’m making rhythm game like this https://youtu.be/VhPQckp0TAQ nothing fancy. I need to open player input in musical timing so I don’t want to be depend on game fps as much as possible. I did such thing with Chunity but they didn’t plan to make it support Android and iOS it seems.

It should be doable without the need to use SenseEventsCallback. To be honest I don’t remember if its implementation is working, but it’s not really needed.
You can achieve what you want sending scores (see https://github.com/rorywalsh/CsoundUnity/blob/6d9259b396e879e496e49ca6d3e2b5b9b9c8ca6e/Runtime/CsoundUnity.cs#L460)
Or maybe have a look at the Sequencer scene that you can find in the Samples (import it from the PackageManager).

Please note that we don’t support iOS yet, but we definitely will in the close future.

Thank you, I’m going to check it out. iOS isn’t problem for me. WebGL support is more interesting at the moment.

Hi @doudar41, welcome to the forum! Let us know how you get on, it sounds like an interesting project. Whenever I have to generate some music in sync with game events, I quantise the timing in Csound so that everything stays in sync. So if I quantise to every beat, any events that arrives before the next beat will wait in a queue until they are ready. It works quite well. There might be some very small sync issues with the visuals, but the music is always perfectly in time, which I think is more important in this context.

1 Like