Cabbage Logo
Back to Cabbage Site

CsoundUnity Package (UPM) development

:laughing: Can you add these when you get a chance! And push, Iā€™ll jump to dev2 thenā€¦

CsoundUnity.cs (35.7 KB) CsoundUnityNode.cs (2.6 KB)

The funny thing is I kept pulling your changes into my local branch here without even noticing we were on different branches!

ok done!

I still hear pops

1 Like

My audio was running pretty smooth. Might it be a good idea now to start creating some examples, so that we all testing with the same scenes?

Yes I added my current scene to samples!
It seems the ref to the csd is mantained! No need to update it (never tried this)
Of course a lot of debugging has to be done, I feel thereā€™s a lot of things that can break with the FileWatcher and Editor stuff

Cool. Iā€™ll have a look at your sample so I can add a few of my own for testing. :+1:

1 Like

Cool thing is that in the CsoundUnityNode inspector appears an audiometer when playing!

I know. What great developers we are :rofl::rofl:

1 Like

If OnAudioFilterRead is implemented a VU meter is shown in the Inspector displaying the outgoing sample level. The process time of the filter is also measured and the spent milliseconds are shown next to the VU meter. The number turns red if the filter is taking up too much time, meaning the mixer will be starved of audio data.

https://docs.unity3d.com/2019.1/Documentation/ScriptReference/MonoBehaviour.OnAudioFilterRead.html

Nice to have!
In CsoundUnity we donā€™t see it because we override the inspector, but maybe we can bring it back somehow

I just did a fresh checkout of the the current dev2 branch and created a new Unity project. Into a CsoundUnityPacakage folder in my projectā€™s Packages directory I pasted all the files from the current branch. When i start unity Iā€™ve a few errors that are preventing me from running the sceneā€¦:

After restarting the project I get some different errors:

Maybe Iā€™ll start it again and it will work :laughing: 3rd time lucky!

What I did to make it work was cloning the repo in the packages folder, if it exists already delete it and recreate it, and without going to unity (that will recreate the manifest.json) clone the repo there

1 Like

So I just did that, clone into Project/Pacakges, but I still get the same error as above, specifically the ones about CsoundUnity not recognised in CsoundUnityEditor?

Iā€™m also getting these warningsā€¦

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(715,18): warning CS3014: 'CsoundUnityBridge.ChannelInfo' cannot be marked as CLS-compliant because the assembly does not have a CLSCompliant attribute
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 715)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(717,54): warning CS3001: Argument type 'CsoundUnityBridge.ChannelType' is not CLS-compliant
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 717)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(717,78): warning CS3001: Argument type 'CsoundUnityBridge.ChannelDirection' is not CLS-compliant
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 717)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(724,28): warning CS3003: Type of 'CsoundUnityBridge.ChannelInfo.Type' is not CLS-compliant
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 724)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(725,33): warning CS3003: Type of 'CsoundUnityBridge.ChannelInfo.Direction' is not CLS-compliant
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 725)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(733,18): warning CS3014: 'CsoundUnityBridge.ChannelHints' cannot be marked as CLS-compliant because the assembly does not have a CLSCompliant attribute
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 733)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(749,45): warning CS3001: Argument type 'CsoundUnityBridge.ChannelBehavior' is not CLS-compliant
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 749)

Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs(762,32): warning CS3003: Type of 'CsoundUnityBridge.ChannelHints.behav' is not CLS-compliant
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityBridge.cs Line: 762)

Packages\CsoundUnity\Runtime\CsoundUnityNode.cs(23,18): warning CS0414: The field 'CsoundUnityNode.ksmpsIndex' is assigned but its value is never used
 
(Filename: Packages\CsoundUnity\Runtime\CsoundUnityNode.cs Line: 23)

Packages\CsoundUnity\Editor\CsoundUnityEditor.cs(23,22): error CS0246: The type or namespace name 'CsoundUnity' could not be found (are you missing a using directive or an assembly reference?)
 
(Filename: Packages\CsoundUnity\Editor\CsoundUnityEditor.cs Line: 23)

Packages\CsoundUnity\Editor\CsoundFileWatcher.cs(13,12): error CS0246: The type or namespace name 'CsoundUnity' could not be found (are you missing a using directive or an assembly reference?)
 
(Filename: Packages\CsoundUnity\Editor\CsoundFileWatcher.cs Line: 13)

Packages\CsoundUnity\Editor\CsoundUnityEditor.cs(27,5): error CS0246: The type or namespace name 'CsoundUnity' could not be found (are you missing a using directive or an assembly reference?)
 
(Filename: Packages\CsoundUnity\Editor\CsoundUnityEditor.cs Line: 27)

Packages\CsoundUnity\Editor\CsoundFileWatcher.cs(15,36): error CS0246: The type or namespace name 'CsoundUnity' could not be found (are you missing a using directive or an assembly reference?)
 
(Filename: Packages\CsoundUnity\Editor\CsoundFileWatcher.cs Line: 15)

Ok some asmdef could have gone wrong, drag the csound.unity asmdef in the asmdef of the editor, like this:

Ok, Iā€™m up and running now once I added the csound.unity.com reference to the asmdef file settings :wink: I assume end-users wonā€™t need to do this?

The warnings about cls compliance are something I found in Richard code, tried to use them to see what would happen :smiley: I think we can remove some of the [CLSCompliant(true)] around

exactly you have the reference of the csound runtime package missing, drag the com.csound.unity.asmdef file there in the field where it says missing reference

Ok, Iā€™m hearing the clicks now. I donā€™t have them in my local branch, let me take a lookā€¦

:dizzy_face: