Cabbage Logo
Back to Cabbage Site

Csound wrapper/plugin for Unreal Engine

Good to hear from you @virtualHC. Using Csound in UE4 seems pretty trivial, but I think we might definitely need your help setting up the Android stuff. We’re almost finished the next iteration of CsoundUnity. We might return to CsoundUE4 after that :wink:

That’s too bad. On the other hand, if you have already found gainful employment, then no harm no foul :wink:

Is Unreal not overkill for this? If you don’t need absolutely jaw-dropping graphics, I’d suggest using Unity over UE4. On the other hand, if all you’re doing is creating some nice UI elements to interact with some music why use a game engine at all? Just curious. This is not a criticism. Game engines rock. Have you seen the Rage audio system by Rockstar? It’s well cool. I think there are some videos on youtube showcasing some of its features. Of course it’s completely proprietary too afaik. So yeah, if you’re trying to create something like that, then a game engine is the way to go!

[edit] Here’s some YouTube footage of the Rage Audio system…

Will check the Rage stuff after work, I guess we went Unreal because of the fact that it uses c++ over c#, and we have like a years worth of c++ code we want to be able to access, I’m sure there’s a way to make it portable but we kind of do want jaw dropping graphics at some point, or at least a foundation which DOES allow for that! Obviously I have to be quite vague about our end goals and stuff, but THINK it makes sense for us to use Unreal, was using Juce for it all previously but didn’t want to have to reinvent the wheel for like player movement etc when Unreal just comes with that as boilerplate!

1 Like

By the way this is such a dumb one and hope it isn’t annoying, but with your example, how would I go about connecting that to the DAC? I assume its something to do with blueprints hahaha

You mean if you want to access audio input? If it’s output you mean I can send a screen if my BP…

yeah it’s output, I found the Component we made in the BP but can’t figure out how to get that out to speakers

This is based on the simple FPS template…

1 Like

The Play Sound At Location is not obviously not used in this context…

Again you’re an absolute saint, I should REALLY do some tutorials instead of relying on the cabbage games forum hahahah thank you so much again!

Better stick with the Cabbage games forum. This kind of stuff is gold for new users. Btw, you should use -d -n flags in your .csd CsOptions. Otherwise Csound might try writing to DAC or disk…

Yeah actually, like had I found this when spending hours googling I probably would have cried with joy, no sound as yet but probably something I missed my end, its TANGIBLE

Id’ send you the entire project, but it’s ridiculously big?

[edit] just compressing it now… might take awhile to upload… I’ll send you a link shortly…

Yeah they’re huge, and I’m using TwinStickShooter as the blueprint (closer to what we want I THINK), was your Start node auto generated in the blueprint?

Everything was auto generated apart from the last bit I added myself…

I’m just creating a OneDrive link, but it’s going to take quite some time for it to upload. I’ll send you a link when it’s ready.

Sweet no rush at all, thanks so much!! As soon as this thing makes a single sound I am cracking open infinite cans

https://1drv.ms/u/s!Ah4mHoWvP_GcgbEoXsAw9foviDVtXQ?e=wNTMo0

Downloading, may well take 100 years, can’t wait to test it, thanks again! also (unrelated) but I just dropped you an email re government secrets for your perusal

So my Linux machine did NOT wanna open your template but I copied it pretty much line for line, so I get crashes in the OnGenerateAudio() function, but if I remove that stuff, it DOES compile successfully, would it have anything to do with the fact that in that setup, it recompiles the csd every time you press shoot? Wondering if it’d be better off to compile the csd in a constructor in that class and then just trigger scoreEvents in Init and read spout in OnGenerateAudio()? (Edit 2.0, the problem with doing that is the SynthComponent actually gets instantiated every time shoot is pressed, so it’s still going to compile the csd multiple times)
This is the terminal output:

backtrace() returned 12 addresses
/usr/local/lib/libcsound64.so.6.0(+0x4606d) [0x7f3eec82a06d]
/lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f3f777f6210]
/home/meijis/Dev/Projects/KalideFPS/Binaries/Linux/libUE4Editor-KalideFPS-5532.so(_ZN14UCsoundWrapper15OnGenerateAudioEPfi+0x5e) [0x7f3f3955034e]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-Engine.so(_ZN20USoundWaveProcedural15GeneratePCMDataEPhi+0xb4) [0x7f3f7e9826c4]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-AudioMixer.so(+0xc221c) [0x7f3f766d621c]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-AudioMixer.so(+0xc0f75) [0x7f3f766d4f75]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-AudioMixer.so(+0xc0c29) [0x7f3f766d4c29]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-Core.so(+0x5facf8) [0x7f3f80ac1cf8]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-Core.so(+0x5f61d7) [0x7f3f80abd1d7]
/home/meijis/libs/UnrealEngine/Engine/Binaries/Linux/libUE4Editor-Core.so(+0x5c1ea0) [0x7f3f80a88ea0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x9609) [0x7f3f8140d609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f3f778d2103]
Csound tidy up: Segmentation fault
end of score. overall amps: 0.00000
overall samples out of range: 0
0 errors in performance

Is that Init() method called each time someone shoots? That doesn’t seem right? But even still, it shouldn’t be causing any crashes. Are you trying to run it with my simple .csd file?