should be this:
https://docs.unity3d.com/ScriptReference/EditorGUILayout.Popup.html
Iāll take a look, I like doing editor stuff
By all means. That would be great. I am very tempted to start looking into the CsoundUnity child components, but Iām kind of waiting till the dust settles on this stage of development. Am I correct in saying that the streaming assets folder is no longer needed?
Yes weāre not using it anymore!
Mission complete!
We have all the methods to exchange buffers, so we could test if different instances of CsoundUnity can talk to each other exchanging data?
We donāt need to use any buffer stuff. Itās much easier than that. If I get a chance over the weekend Iāll try to put together a rough draft. If it works, Iām sure youāll laugh at how simple it is!
I hope so! Great weāre going fast and far!
combobox bounds(445, 20, 85, 20), channel("testCombobox"), value(1), text("Tri.","Random"), identchannel("ID10"), visible(0)
how does the identchannel in the combobox work?
what kind of message should I send to csound?
trying this code but it doesnāt compile on cabbage:
<Cabbage>
form caption ("Test Csound"), size(300, 200)
hslider bounds(0, 0, 300, 50) range(20, 16000, 440, 1, 0.001) valuetextbox(1) channel("freqSlider") value(440) velocity(50)
combobox bounds(0, 60, 85, 20), channel("testCombobox"), value(2), text("Sine", "Boh"), channeltype("string")
; EDIT: the value was wrong, it was value("1")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
;-n -d -m0d
;-odac
-n ; -m0d
</CsOptions>
<CsInstruments>
;sr = 44100
;ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
a1 oscil .2, chnget:k("freqSlider"), chnget:i("testCombobox")
outs a1, a1
endin
</CsInstruments>
<CsScore>
f0 3600
f1 0 4096 10 1
f2 0 4096 10 1 .3 .15 .07
i1 0 5
</CsScore>
now it compiles on Cabbage, Iāll try to make it work on the editor too
Donāt bother with string comboboxes, they are not really needed as far as I can tell, or at least not for now. Here is the one I was testing with. You can change tone with the combobox
SimpleSynth.csd (1.6 KB)
I am pushing the fixed intslider!
Then Iāll add the dropdown!
Itās done, it was easy! but the names are a bit ugly I have to split them better
ok itās there to test!
Great. Iāll try it it tomorrow and get back to you
Just trying this out now. It works great. Iām very happy to have this, it will make porting Cabbage instruments much easier.
You know the one must drag a Csound file to the CsoundUnity component? Do you think it would be more intuitive to have the little circle on the right hand side to let one chose a file in the current project? This thing I mean:
The reason itās not there is because I couldnāt figure out how to do it when I first started learning Unity. You like editor stuff right?!
Yes I can look into it, shouldnāt be difficult! Would you leave the Drag Area or should I remove it?
Btw Iāve just finished implementing the FileWatcher feature, iām testing this right now!
Want me to push so that you can try also this?
Yes please. I think it you implement the Unity way of browsing, then a file drag should also work right? Or?
Yes it should be sufficient to have just that field.
Iāll remove the drag area then!
Btw, do you know how to change the number of audio channels in an AudioSource? CsoundUnity should probably match the number of channels set in the Csound instrument? Or do we force everything to be stereo?
I think AudioSource should do it alone! And when OnAudioFilterRead is called just a channel is passed.
Maybe we could read that value in Awake?
And thinking more about those fieldsā¦
I think the problem is that those fields refer to unity assets, and csds are not!
Let me finish the FileWatcher then Iāll look into it (maybe tomorrow)
I think the number of channels is set by the clip, and if no clip is given itās 2. I couldnāt see any methods for setting the number of channels. But I didnāt look very hard!
I think this is the problem I faced the last time too. I was hoping the situation was different now. Anyhow, itās not too bad the way it is, but itās not very Unity-esqueā¦
Now I remember that I saw something that could help: create an inspector field for a scene asset.
This should do it!
https://docs.unity3d.com/ScriptReference/AudioSpeakerMode.html this is not so useful
Thereās no mention about channels other than this.