Cabbage Logo
Back to Cabbage Site

CsoundUnity examples

Hey, sorry for the slow reply. Yeah it was that one he posted here! New synth for Cabbage 2

I’ll give @giovannibedetti’s tip a shot now.
JM_sub.csd (67.2 KB)

This one swaps out cps values for MIDI note numbers. Note that it will also run in Cabbage with the keyboard because I swapped:

--midi-key-cps=4

in the CsOptions section with:

--midi-key=4

Let me know how it goes :wink:

Thanks Rory, but I think you forgot to attach the edited version. Assuming the CsOptions isn’t the only thing that needs changing.

JM_sub.csd (67.2 KB)

Shoot, sorry about that!

1 Like

This works perfectly!

So, other than the CsOptions, the only changes are from lines 902-908?
From:

	if gkDetuneOn==1 then
		kFreq2 = p4+gkDetune*0.5
		kFreq1 = p4-gkDetune*0.5	
	else 
		kFreq1 =p4
		kFreq2 =p4
	endif

To:

if gkDetuneOn==1 then
        kFreq2 = cpsmidinn(p4)+gkDetune*0.5
        kFreq1 = cpsmidinn(p4)-gkDetune*0.5
	else 
		kFreq1 =cpsmidinn(p4)
		kFreq2 =cpsmidinn(p4)
	endif

Great!
I am very curious to try out your demo!

Me too. Feel free to post a few screencasts of the development stages!

Yeah for sure! I’ll try and get a demo vid here by tonight.

1 Like

Ok here’s a quick screen cap of progress so far. https://www.youtube.com/watch?v=ZFsV3_QgDw8

Got panning mapped left/right as well as a few other parameters when you raise/ lower the sun by holding spacebar.

I’ll probably do a few more additions on it, mostly visual. But let me know if you have any other ideas!

1 Like

This looks and sounds great. Keep them coming!

Very cool! We definitely need examples like that!
The logic is very smart we will reuse it for sure!

Thanks! well, i’m not an expert with coding so some of it may well be approached in a more efficient way. That said, I’d be happy to add it as an example for the package so you can tweak it and flesh out some of the editor interaction. Though you’ll have to guide me through getting it set up properly on the repo.

Actually one addition I’d love to make is some Audio Spectrum reactive particle effects. My previous set-up didn’t allow me to have precision as I could only feed in MIDI data. Though I’d likely have to use something like https://github.com/keijiro/Reaktion. Would this pose an issue for the example package?

Or maybe there’s no need as it doesn’t directly show the capabilities of the package? Just let me know :slight_smile:

I think it’s a good idea to do an example with the Audio Spectrum, but there’s no need for external packages. We can find the spectrum data pretty easily!
https://docs.unity3d.com/ScriptReference/AudioSource.GetSpectrumData.html
I’m thinking of creating a granular-like sequencer with notes represented graphically, like a visual score.
That would be very interesting, but not an easy task!

And on top of that there is no end to the way we can analyse sounds in Csound :wink:

That is awesome!! I’ll definitely give this a shot.

Granular sequencer sounds very interesting, look forward to seeing a demo of it.

By the way, I came across ToneZ in Cabbage Recipes, what an awesome synth this is! Looks/ sounds very professional. Is there a place I can find more Instruments and Effects of this calibre? Even if they are paid?

Oh here’s a new one!

Dropping the ToneZ synth into CSoundUnity component gives me this:
image

I Should mention I’ve just pulled the latest origin on Dev2

I also am getting a: “filewatcher: Heuston, we have a problem…” which disables all CSoundUnity instances on entering Playmode.

Cool his code breaks our parse!
I’m having a look.

Ha, good luck! I’ve been over that code while @TONITORMX was writing it, it’s pretty intense! He also uses a custom preset manager, that might actually work fine in Unity, as long as we can fix our parser…

I pushed an update to dev2.


Now it parses barely everything, but then on sendscore Unity explodes :exploding_head:
I commented some code in the ToneZ csd (preset saving)
ToneZ.csd (143.7 KB)

EDIT:
the log of the crash:

QObject: Cannot create children for a parent that is in a different thread.
(Parent is QObject(0x7f92c8bbd710), parent’s thread is QThread(0x7f92c6001400), current thread is Thread(0x7f92c67f61f0)

Ugly stuff!