Cabbage Logo
Back to Cabbage Site

OSC with CSound

Ok this is firstly a CSound Question:
I’m trying to connect Iannix with CSound and in special with Cabbage.
So I’m have coded and selected together a easy Script.

<CsoundSynthesizer>
<CsOptions>
-odac           -iadc    ;;;RT audio I/O
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1


;instrument will be triggered by keyboard widget
instr 1
kf1 init 0
kf2 init 0

iTest OSCinit 57120

kTrig metro 2
if kTrig == 1 then
     ; kk  OSClisten iTest, "/cursor", "ff", kf1, kf2
endif
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...

i1 0 15
</CsScore>
</CsoundSynthesizer>

And I’m geth this error

error: syntax error, unexpected T_IDENT (token “OSCinit”) from file Test001.cs (1)
line 17:

iTest OSCinit <<<
Unexpected untyped word iTest when expecting a variable

And i not know what is wrong

What OS are you using again? It looks like the OSC opcodes aren’t included for some reason.

[p.s.] would you mind formatting your code when you post it? If you don’t large sections will be missing as they are interpreted as HTML tags.

I’m using Linux Mind.

Can you check the examples in the Csound manual and see if they run. OSCInit is usually called from outside the instrument in the global header space. Can you try putting it there, although I don’t think that is the issue.

Ok, this might be a rubish question … But can it be that I have to install first a OSC Server. I have nothing before use OSC. So it might be a good Queston to lock licke so basic things. I have searched in Google and web.de for a advice, if Linux Mint support OSC, support OSC out of the box, or what must be first to be install, to enable OSC support.

Mungo1981 :hushed: :innocent: :worried:

Csound provides an interface to the liblo library. When you built Csound it will automatically build the OSX interfaces if you have liblo installed. How did you build Csound? Or are you using a prebuilt version?

Excuse me, but I’m have nothing more done to install cSound as to do what you have said to install Cabbage. And I will use it in Cabbage. But when I be more accorate I think I have install csound por with
apt-get install csound

When you run Cabbage from the command line what does it print? It should give you a version number…

First of all Cabbage at the Comand-Line will get

oem@oem-HP-255-G5-Notebook-PC ~ $ Cabbage
Cannot connect to server socket err = Datei oder Verzeichnis nicht gefunden
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
Shutdown

Second, at the About Section in the Cabbage Desktop at Help.
I will get following Message:
Cabbage(64bit) V2.0.02

Apologies, I meant to ask that you run csound from the command line…

Second B, You will know the Version in because of: from you are the deb-File to install it. But we maybe have not install all dependences. So it would might be. We have to do it now.

Third, This are the Error Message who will get returned by Cabbage to try to Execute the Script:
http://www.csounds.com/manual/html/examples/OSCmidircv.csd

Csound output message console
UnifiedCSD: /home/oem/MeineWeiterenCabbageVersuche/Iannix-Vorversuche/VorVersuch2V1.csd
STARTING FILE
Creating options
Herstellen des Orchesters
closing tag
Creating score
rtaudio: ALSA module enabled
rtmidi: ALSA Raw MIDI module enabled

Fehler: syntax error, unexpected T_IDENT (Symbol “OSCinit”) von Datei /home/oem/MeineWeiterenCabbageVersuche/Iannix-Vorversuche/VorVersuch2V1.csd (1)
Zeile 19:

gilisten OSCinit <<<
Unexpected untyped word gilisten when expecting a variable
Parsing failed due to invalid input!
Stopping on parser failure
cannot compile orchestra

Fourth. Lock at Answer Section First. In the above text. But I think this is not what you would that I done

Excuse me that I not have try the Examples out of the Manual directly. I’m was on work. And now I’m firstly at home. So I would have no access to my Laptop.

I’m looking for the version of Csound you’re using? Check the contents of /usr/local/lib, are there any Csound files in there?

There are following Diretorys:
csound libcsound64.so.6.0 libluajit-5.1.so.2.0.5 python3.5
libcsnd6.so libluajit-5.1.a lua swipl-6.0.2
libcsnd6.so.6.0 libluajit-5.1.so pkgconfig
libcsound64.so libluajit-5.1.so.2 python2.7

Sorry, with the Version Id of csound. I have work to hard, by this heat her in middle Germany. So I have at first understand you would the Cabbage ID. So her again the csound ID Section.

oem@oem-HP-255-G5-Notebook-PC /usr/local/lib $ csound
time resolution is 1000.000 ns
0dBFS level = 32768.0
–Csound version 6.12 beta (double samples) May 24 2018
[commit: 0e705f1b6c1936d0bf079c1af76737e0ee35eb96]
libsndfile-1.0.25

So I have locked for a module liblo. liblo are installed in the Directory /home/oem/csound/mingw64/packages. And there are a File FindLIBLO.cmake in /home/oem/csound/csound/cmake/Modules

Can you post the output of this:

ls /usr/lib/csound/plugins64-6.0

You should see a libosc.so…

Yes it gets this:

oem@oem-HP-255-G5-Notebook-PC / $ ls /usr/lib/csound/plugins64-6.0
libampmidid.so libfluidOpcodes.so libosc.so libsignalflowgraph.so
libbuchla.so libfractalnoise.so libpadsynth.so libstdutil.so
libcellular.so libimage.so libplaterev.so libstk.so
libchua.so libipmidi.so libpmidi.so libsystem_call.so
libcontrol.so libjacko.so libpy.so liburandom.so
libcs_date.so libjackTransport.so librtalsa.so libvirtual.so
libdoppler.so libjoystick.so librtjack.so libwidgets.so
libdssi4cs.so liblinear_algebra.so librtpa.so
libexciter.so libLuaCsound.so librtpulse.so
libfareygen.so libmixer.so libserial.so

That confirms you don’t have the OSC opcodes. If you built Csound yourself you will need to enable the OSX stuff. Check the CMake files for that. Or if you use CmakeGUI you can enable the building of those opcodes there. Alternatively, you could just install the Csound deb package:
https://packages.debian.org/source/sid/csound
I’m pretty certain that ships with the osc stuff.