As a new-comer to csound world I was wondering to which direction I should proceed with the UI.
Especially when it has been mentioned that there is not much interest anymore to develop or maintain the csound FL-functions.
I suppose most people choose nowadays python and one of the available UI-kits for that purpose.
My background is control systems R&D for an automation system.
I have been working there e.g. by utilising both java and Eclipse. Also a very little amount of python.
(And Matlab/Octave)
So maybe the decision was quite straightforward.
My system is Xubuntu 22.04 with Ubuntu Studio installed. So what happened then ?
I wanted to tell about the required steps for those who choose Eclipse as an IDE for java-csound-coding.
(by the way, Eclipse could be utilised also for python-development)
1 Eclipse installation - standard, no problems
2 csnd6.jar
1'st java example (example2) => problems because Eclipse can't find csnd6.jar.
It turned out that this jar does not automatically come with UStudio but there's a separate package for that.
I installed and told Eclipse where this library is located
Now the java-code looks correct.
3 Run
Trying to run - no success => (something like)
java.lang.UnsatisfiedLinkError: no native library in java.library.path.
This was not that easy anymore, because the actual location of the related c-code library is
/usr/lib/x86_64-linux-gnu/jni/.
I found the correct location, but how to tell about that to Eclipse, because the normal way with the jar-packages doesn't succeed ?
Fortunately I found instructions for this at a web-page (by Google) What is java.library.path? How to set in Eclipse IDE? Example
On that page there's a chapter that handles how to set native library location:
3 Ways to set java.library.path in Eclipse IDE
Now it is possible to run java-code with the embedded csound-code.
4 cmd-line run
There's still (at least?) one problem when I try to run the code with the default java-engine from the command-line.
The java-version for that is older that the one in Eclipse, but his should be easy to take to account on the Eclipse-side.
I use this in Blue and it's been working well for me. There's some
feature not implemented compared to csnd6.jar, but if you need
something just file an issue on github and can take a look.
Another option is running Csound from within either Pure Data or Max and doing your UI there. I’ve wound up going down that route as the UI particulars are not that important to me (as in, I’m fine with what Max gives me) and one gets the benefit of handling MIDI and networking input in the host too. YMMV, but I’ve become a big fan of only coding what I need to and doing the plumbing quick and dirty in Max.
If I understand correctly csnd6.jar is the “official” package for connecting java-code to csound.
So what are the benefits of using CsoundJNI instead of csnd6 ?
I suppose csnd6 works also properly ?
For Iain Duncan:
Concerning the UI in e.g. Pure Data or Max, both Python and Java can be easily used also for some challenging matrix/vector operations if needed
by utlilising e.g. numpy in Python or Colt in Java.
I don’t know what do you mean by handling MIDI ? I was supposed to use csound for that.
Actually my first simple test csd-file is reading in events from a MIDI-file to modify the value in an FLslider according to the MidiCC-value.
I use this in Blue and it’s been working well for me. There’s some
feature not implemented compared to csnd6.jar, but if you need
something just file an issue on github and can take a look.
As a new-comer to csound world I was wondering to which direction I should proceed with the UI.
Especially when it has been mentioned that there is not much interest anymore to develop or maintain the csound FL-functions.
I suppose most people choose nowadays python and one of the available UI-kits for that purpose.
My background is control systems R&D for an automation system.
I have been working there e.g. by utilising both java and Eclipse. Also a very little amount of python.
(And Matlab/Octave)
So maybe the decision was quite straightforward.
My system is Xubuntu 22.04 with Ubuntu Studio installed. So what happened then ?
I wanted to tell about the required steps for those who choose Eclipse as an IDE for java-csound-coding.
(by the way, Eclipse could be utilised also for python-development)
1 Eclipse installation - standard, no problems
2 csnd6.jar
1’st java example (example2) => problems because Eclipse can’t find csnd6.jar.
It turned out that this jar does not automatically come with UStudio but there’s a separate package for that.
I installed and told Eclipse where this library is located
Now the java-code looks correct.
3 Run
Trying to run - no success => (something like)
java.lang.UnsatisfiedLinkError: no native library in java.library.path.
This was not that easy anymore, because the actual location of the related c-code library is
/usr/lib/x86_64-linux-gnu/jni/.
I found the correct location, but how to tell about that to Eclipse, because the normal way with the jar-packages doesn’t succeed ?
Fortunately I found instructions for this at a web-page (by Google) https://javarevisited.blogspot.com/2013/04/what-is-javalibrarypath-how-to-set-in-Eclipse.html#axzz8W5HHEJsO
On that page there’s a chapter that handles how to set native library location:
3 Ways to set java.library.path in Eclipse IDE
Now it is possible to run java-code with the embedded csound-code.
4 cmd-line run
There’s still (at least?) one problem when I try to run the code with the default java-engine from the command-line.
The java-version for that is older that the one in Eclipse, but his should be easy to take to account on the Eclipse-side.
Hi Risto, in case it is helpful… what I do is use the csound object in Max (I ported Victor’s csound6 Pd object to Max) and handle all MIDI in the Max layer, translating from MIDI to score events and communicating with csound via Max messages of real-time score events. Additionally, all patch controls also come in from Max via the channel system. Personally, I find this much more convenient than using Csounds MIDI layer - it keeps my csound code far more minimal and focused only on DSP, and I really like controlling instruments with score messages. I have (many years ago) done the MIDI and FLTK thing in Csound itself, but it’s not an area where I like working in Csound relative to other languages.
I am also the author of Scheme for Max and Scheme for Pd, which let one use s7 Scheme (lisp) in Max and Pd, with scheduler integration. So I send score messages to csound directly from Scheme code that also runs in the Max host. I’ve found this to be a very productive triad - csound does only sound, Scheme does sequencing/scoring/algorithms, and Max does the containing plumbing, MIDI input, and GUI widgets (and I can put the whole mess in Ableton Live if want to use commercial tools alongside it.)
At our university we are learning Common Lisp as basis für algorithmic composition. I will dig deeper in your work!
Are you sharing the ported csound object somewhere?
@all:
is there a place in the web where all possible solutions for creating a GUI for csound is listed? i guess there is a ton of possibilities and i’m always surprised what exists out there.
I guess a collection like this with examples on the csound webpage would make csound even more interesting.
When I want a GUI, I use Open Sound Control. Runs in the browser, looks very good, quite powerful. I run the server on the same Raspberry Pi 4 on which I run Csound. https://openstagecontrol.ammd.net/
I loaded the CsoundJNI.jar version and if i’m right it doesn’t need an external c-library at all because it includes the .so-file (or .dll for Windows) by itself.
I suppose the usage is the same as with the original, at least the basic methods ?
When I want a GUI, I use Open Sound Control. Runs in the browser, looks very good, quite powerful. I run the server on the same Raspberry Pi 4 on which I run Csound. https://openstagecontrol.ammd.net/
Ian, this sounds really great!
At our university we are learning Common Lisp as basis für algorithmic composition. I will dig deeper in your work!
Are you sharing the ported csound object somewhere?
@all:
is there a place in the web where all possible solutions for creating a GUI for csound is listed? i guess there is a ton of possibilities and i’m always surprised what exists out there.
I guess a collection like this with examples on the csound webpage would make csound even more interesting.
Philipp
Hi Risto, in case it is helpful… what I do is use the csound object in Max (I ported Victor’s csound6 Pd object to Max) and handle all MIDI in the Max layer, translating from MIDI to score events and communicating with csound via Max messages of real-time score events. Additionally, all patch controls also come in from Max via the channel system. Personally, I find this much more convenient than using Csounds MIDI layer - it keeps my csound code far more minimal and focused only on DSP, and I really like controlling instruments with score messages. I have (many years ago) done the MIDI and FLTK thing in Csound itself, but it’s not an area where I like working in Csound relative to other languages.
I am also the author of Scheme for Max and Scheme for Pd, which let one use s7 Scheme (lisp) in Max and Pd, with scheduler integration. So I send score messages to csound directly from Scheme code that also runs in the Max host. I’ve found this to be a very productive triad - csound does only sound, Scheme does sequencing/scoring/algorithms, and Max does the containing plumbing, MIDI input, and GUI widgets (and I can put the whole mess in Ableton Live if want to use commercial tools alongside it.)
Happy to answer questions if it’s something you want to look at more closely.
iain
If I understand correctly csnd6.jar is the “official” package for connecting java-code to csound.
So what are the benefits of using CsoundJNI instead of csnd6 ?
I suppose csnd6 works also properly ?
For Iain Duncan:
Concerning the UI in e.g. Pure Data or Max, both Python and Java can be easily used also for some challenging matrix/vector operations if needed
by utlilising e.g. numpy in Python or Colt in Java.
I don’t know what do you mean by handling MIDI ? I was supposed to use csound for that.
Actually my first simple test csd-file is reading in events from a MIDI-file to modify the value in an FLslider according to the MidiCC-value.
–Risto
ma 1. huhtik. 2024 klo 15.45 Steven Yi (stevenyi@gmail.com) kirjoitti:
I’d recommend using my CsoundJNI for Java:
I use this in Blue and it’s been working well for me. There’s some
feature not implemented compared to csnd6.jar, but if you need
something just file an issue on github and can take a look.
As a new-comer to csound world I was wondering to which direction I should proceed with the UI.
Especially when it has been mentioned that there is not much interest anymore to develop or maintain the csound FL-functions.
I suppose most people choose nowadays python and one of the available UI-kits for that purpose.
My background is control systems R&D for an automation system.
I have been working there e.g. by utilising both java and Eclipse. Also a very little amount of python.
(And Matlab/Octave)
So maybe the decision was quite straightforward.
My system is Xubuntu 22.04 with Ubuntu Studio installed. So what happened then ?
I wanted to tell about the required steps for those who choose Eclipse as an IDE for java-csound-coding.
(by the way, Eclipse could be utilised also for python-development)
1 Eclipse installation - standard, no problems
2 csnd6.jar
1’st java example (example2) => problems because Eclipse can’t find csnd6.jar.
It turned out that this jar does not automatically come with UStudio but there’s a separate package for that.
I installed and told Eclipse where this library is located
Now the java-code looks correct.
3 Run
Trying to run - no success => (something like)
java.lang.UnsatisfiedLinkError: no native library in java.library.path.
This was not that easy anymore, because the actual location of the related c-code library is
/usr/lib/x86_64-linux-gnu/jni/.
I found the correct location, but how to tell about that to Eclipse, because the normal way with the jar-packages doesn’t succeed ?
Fortunately I found instructions for this at a web-page (by Google) https://javarevisited.blogspot.com/2013/04/what-is-javalibrarypath-how-to-set-in-Eclipse.html#axzz8W5HHEJsO
On that page there’s a chapter that handles how to set native library location:
3 Ways to set java.library.path in Eclipse IDE
Now it is possible to run java-code with the embedded csound-code.
4 cmd-line run
There’s still (at least?) one problem when I try to run the code with the default java-engine from the command-line.
The java-version for that is older that the one in Eclipse, but his should be easy to take to account on the Eclipse-side.
Hi Phillip, the csound object is here: https://github.com/iainctduncan/csound_max
I have an improvement planned for the next week or so to make using it in Live easier, and will be working on getting this merged with csound’s main repo after that.
We won't be using a csnd7.jar for Csound 7 and moving to either
CsoundJNI or using Java's latest FFI feature (though that would
require Java 22). As for CsoundJNI, it should work out of the box with
installed versions of Csound on Windows, Mac, and Linux, across a
number of different architectures. csnd6.jar requires having
libcsnd.so (I think that's the name?) and libcsound64.so on the
library path and that usually requires some extra configuration to get
right, while CsoundJNI has a list of common paths and just has to find
libcsound64.so (CsoundJNI includes the native lib it needs to call
libcsound64.so).
You can get csnd6.jar to work, it just takes some extra configuration.
(Actually this is a good reminder for me to get working on the Java
FFI version...)
So I started to try out CsoundJNI. The first tested piece of code was example4.java (by Steven Yi 2013.10.28) from the set of simple examples.
I could modify the code quite easily to use CsoundJNI instead of csnd6 (some CAPS → SMALLCAPS etc.) but here is one line where
I couldn’t find a corresponding definition in CsoundJNI:
// Create a new CsoundPerformanceThread, passing in the Csound object
CsoundPerformanceThread t = new CsoundPerformanceThread(c);
We won’t be using a csnd7.jar for Csound 7 and moving to either
CsoundJNI or using Java’s latest FFI feature (though that would
require Java 22). As for CsoundJNI, it should work out of the box with
installed versions of Csound on Windows, Mac, and Linux, across a
number of different architectures. csnd6.jar requires having
libcsnd.so (I think that’s the name?) and libcsound64.so on the
library path and that usually requires some extra configuration to get
right, while CsoundJNI has a list of common paths and just has to find
libcsound64.so (CsoundJNI includes the native lib it needs to call
libcsound64.so).
You can get csnd6.jar to work, it just takes some extra configuration.
(Actually this is a good reminder for me to get working on the Java
FFI version…)
If I understand correctly csnd6.jar is the “official” package for connecting java-code to csound.
So what are the benefits of using CsoundJNI instead of csnd6 ?
I suppose csnd6 works also properly ?
For Iain Duncan:
Concerning the UI in e.g. Pure Data or Max, both Python and Java can be easily used also for some challenging matrix/vector operations if needed
by utlilising e.g. numpy in Python or Colt in Java.
I don’t know what do you mean by handling MIDI ? I was supposed to use csound for that.
Actually my first simple test csd-file is reading in events from a MIDI-file to modify the value in an FLslider according to the MidiCC-value.
I use this in Blue and it’s been working well for me. There’s some
feature not implemented compared to csnd6.jar, but if you need
something just file an issue on github and can take a look.
As a new-comer to csound world I was wondering to which direction I should proceed with the UI.
Especially when it has been mentioned that there is not much interest anymore to develop or maintain the csound FL-functions.
I suppose most people choose nowadays python and one of the available UI-kits for that purpose.
My background is control systems R&D for an automation system.
I have been working there e.g. by utilising both java and Eclipse. Also a very little amount of python.
(And Matlab/Octave)
So maybe the decision was quite straightforward.
My system is Xubuntu 22.04 with Ubuntu Studio installed. So what happened then ?
I wanted to tell about the required steps for those who choose Eclipse as an IDE for java-csound-coding.
(by the way, Eclipse could be utilised also for python-development)
1 Eclipse installation - standard, no problems
2 csnd6.jar
1’st java example (example2) => problems because Eclipse can’t find csnd6.jar.
It turned out that this jar does not automatically come with UStudio but there’s a separate package for that.
I installed and told Eclipse where this library is located
Now the java-code looks correct.
3 Run
Trying to run - no success => (something like)
java.lang.UnsatisfiedLinkError: no native library in java.library.path.
This was not that easy anymore, because the actual location of the related c-code library is
/usr/lib/x86_64-linux-gnu/jni/.
I found the correct location, but how to tell about that to Eclipse, because the normal way with the jar-packages doesn’t succeed ?
Fortunately I found instructions for this at a web-page (by Google) https://javarevisited.blogspot.com/2013/04/what-is-javalibrarypath-how-to-set-in-Eclipse.html#axzz8W5HHEJsO
On that page there’s a chapter that handles how to set native library location:
3 Ways to set java.library.path in Eclipse IDE
Now it is possible to run java-code with the embedded csound-code.
4 cmd-line run
There’s still (at least?) one problem when I try to run the code with the default java-engine from the command-line.
The java-version for that is older that the one in Eclipse, but his should be easy to take to account on the Eclipse-side.
Yes, that is something that is not implemented in CsoundJNI at this
time. I implemented the parts of the API that were necessary for Blue
and had not gone further. I use Java Threads with Csound objects
myself. I'll try to schedule some time to review API differences as
well as Java 22 FFI implementation, but until then a Thread that calls
cs.performKsmps() in a while-loop should do the job.
Thanks Steven,
I noticed that in addition to CsoundPerformanceThread also CsoundMYFLTArray is missing.
Then the generic GetChannelPtr as such is missing but instead of that getAudioChannelPtr and getControlChannelPtr
are available.
As a beginner I can’t tell if those are important or not but it seems that the corresponding functions are also
in use in the python-examples.
I would guess that CsoundPerformanceThread is important if the instrument -section is very CPU-hungry.
Yes, that is something that is not implemented in CsoundJNI at this
time. I implemented the parts of the API that were necessary for Blue
and had not gone further. I use Java Threads with Csound objects
myself. I’ll try to schedule some time to review API differences as
well as Java 22 FFI implementation, but until then a Thread that calls
cs.performKsmps() in a while-loop should do the job.
So I started to try out CsoundJNI. The first tested piece of code was example4.java (by Steven Yi 2013.10.28) from the set of simple examples.
I could modify the code quite easily to use CsoundJNI instead of csnd6 (some CAPS → SMALLCAPS etc.) but here is one line where
I couldn’t find a corresponding definition in CsoundJNI:
// Create a new CsoundPerformanceThread, passing in the Csound object
CsoundPerformanceThread t = new CsoundPerformanceThread(c);
We won’t be using a csnd7.jar for Csound 7 and moving to either
CsoundJNI or using Java’s latest FFI feature (though that would
require Java 22). As for CsoundJNI, it should work out of the box with
installed versions of Csound on Windows, Mac, and Linux, across a
number of different architectures. csnd6.jar requires having
libcsnd.so (I think that’s the name?) and libcsound64.so on the
library path and that usually requires some extra configuration to get
right, while CsoundJNI has a list of common paths and just has to find
libcsound64.so (CsoundJNI includes the native lib it needs to call
libcsound64.so).
You can get csnd6.jar to work, it just takes some extra configuration.
(Actually this is a good reminder for me to get working on the Java
FFI version…)
If I understand correctly csnd6.jar is the “official” package for connecting java-code to csound.
So what are the benefits of using CsoundJNI instead of csnd6 ?
I suppose csnd6 works also properly ?
For Iain Duncan:
Concerning the UI in e.g. Pure Data or Max, both Python and Java can be easily used also for some challenging matrix/vector operations if needed
by utlilising e.g. numpy in Python or Colt in Java.
I don’t know what do you mean by handling MIDI ? I was supposed to use csound for that.
Actually my first simple test csd-file is reading in events from a MIDI-file to modify the value in an FLslider according to the MidiCC-value.
I use this in Blue and it’s been working well for me. There’s some
feature not implemented compared to csnd6.jar, but if you need
something just file an issue on github and can take a look.
As a new-comer to csound world I was wondering to which direction I should proceed with the UI.
Especially when it has been mentioned that there is not much interest anymore to develop or maintain the csound FL-functions.
I suppose most people choose nowadays python and one of the available UI-kits for that purpose.
My background is control systems R&D for an automation system.
I have been working there e.g. by utilising both java and Eclipse. Also a very little amount of python.
(And Matlab/Octave)
So maybe the decision was quite straightforward.
My system is Xubuntu 22.04 with Ubuntu Studio installed. So what happened then ?
I wanted to tell about the required steps for those who choose Eclipse as an IDE for java-csound-coding.
(by the way, Eclipse could be utilised also for python-development)
1 Eclipse installation - standard, no problems
2 csnd6.jar
1’st java example (example2) => problems because Eclipse can’t find csnd6.jar.
It turned out that this jar does not automatically come with UStudio but there’s a separate package for that.
I installed and told Eclipse where this library is located
Now the java-code looks correct.
3 Run
Trying to run - no success => (something like)
java.lang.UnsatisfiedLinkError: no native library in java.library.path.
This was not that easy anymore, because the actual location of the related c-code library is
/usr/lib/x86_64-linux-gnu/jni/.
I found the correct location, but how to tell about that to Eclipse, because the normal way with the jar-packages doesn’t succeed ?
Fortunately I found instructions for this at a web-page (by Google) https://javarevisited.blogspot.com/2013/04/what-is-javalibrarypath-how-to-set-in-Eclipse.html#axzz8W5HHEJsO
On that page there’s a chapter that handles how to set native library location:
3 Ways to set java.library.path in Eclipse IDE
Now it is possible to run java-code with the embedded csound-code.
4 cmd-line run
There’s still (at least?) one problem when I try to run the code with the default java-engine from the command-line.
The java-version for that is older that the one in Eclipse, but his should be easy to take to account on the Eclipse-side.
Thanks for pointing those out, I'll note it for when I audit the code.
CsoundPerformanceThread is handy but it's also not as essential in
languages that have threads (e.g., compared to Python). I'll look at
having some kind of implementation of CsoundPerformanceThread
available.
Thanks for that, I'll note it for this work. I think that CsoundJNI is
still a csound6 binding at the moment and will treat it as such. The
Java FFI work I'll treat as experimental and targeting Csound7.
The biggest advantage of CsoundJNI v.s. csnd6 is that the c-coded part is included in the .jar-file.
In the case of csnd6 when you know the location of that library-file, then I think there’s no problem
to use csnd6. I suppose that feature will be included also in the future official .jar-file.
Thanks for that, I’ll note it for this work. I think that CsoundJNI is
still a csound6 binding at the moment and will treat it as such. The
Java FFI work I’ll treat as experimental and targeting Csound7.
Just a note of caution: it may not be worth doing a lot of work on this until we have a new API for 7.0.
I expect a lot of consolidation as well as deletions will be on the way.
Prof. Victor Lazzarini
Maynooth University
Ireland
Warning
This email originated from outside of Maynooth University’s Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
Thanks for pointing those out, I’ll note it for when I audit the code.
CsoundPerformanceThread is handy but it’s also not as essential in
languages that have threads (e.g., compared to Python). I’ll look at
having some kind of implementation of CsoundPerformanceThread
available.
Thanks Steven,
I noticed that in addition to CsoundPerformanceThread also CsoundMYFLTArray is missing.
Then the generic GetChannelPtr as such is missing but instead of that getAudioChannelPtr and getControlChannelPtr
are available.
As a beginner I can’t tell if those are important or not but it seems that the corresponding functions are also
in use in the python-examples.
I would guess that CsoundPerformanceThread is important if the instrument -section is very CPU-hungry.
Yes, that is something that is not implemented in CsoundJNI at this
time. I implemented the parts of the API that were necessary for Blue
and had not gone further. I use Java Threads with Csound objects
myself. I’ll try to schedule some time to review API differences as
well as Java 22 FFI implementation, but until then a Thread that calls
cs.performKsmps() in a while-loop should do the job.
So I started to try out CsoundJNI. The first tested piece of code was example4.java (by Steven Yi 2013.10.28) from the set of simple examples.
I could modify the code quite easily to use CsoundJNI instead of csnd6 (some CAPS → SMALLCAPS etc.) but here is one line where
I couldn’t find a corresponding definition in CsoundJNI:
// Create a new CsoundPerformanceThread, passing in the Csound object
CsoundPerformanceThread t = new CsoundPerformanceThread(c);
We won’t be using a csnd7.jar for Csound 7 and moving to either
CsoundJNI or using Java’s latest FFI feature (though that would
require Java 22). As for CsoundJNI, it should work out of the box with
installed versions of Csound on Windows, Mac, and Linux, across a
number of different architectures. csnd6.jar requires having
libcsnd.so (I think that’s the name?) and libcsound64.so on the
library path and that usually requires some extra configuration to get
right, while CsoundJNI has a list of common paths and just has to find
libcsound64.so (CsoundJNI includes the native lib it needs to call
libcsound64.so).
You can get csnd6.jar to work, it just takes some extra configuration.
(Actually this is a good reminder for me to get working on the Java
FFI version…)
If I understand correctly csnd6.jar is the “official” package for connecting java-code to csound.
So what are the benefits of using CsoundJNI instead of csnd6 ?
I suppose csnd6 works also properly ?
For Iain Duncan:
Concerning the UI in e.g. Pure Data or Max, both Python and Java can be easily used also for some challenging matrix/vector operations if needed
by utlilising e.g. numpy in Python or Colt in Java.
I don’t know what do you mean by handling MIDI ? I was supposed to use csound for that.
Actually my first simple test csd-file is reading in events from a MIDI-file to modify the value in an FLslider according to the MidiCC-value.
I use this in Blue and it’s been working well for me. There’s some
feature not implemented compared to csnd6.jar, but if you need
something just file an issue on github and can take a look.
As a new-comer to csound world I was wondering to which direction I should proceed with the UI.
Especially when it has been mentioned that there is not much interest anymore to develop or maintain the csound FL-functions.
I suppose most people choose nowadays python and one of the available UI-kits for that purpose.
My background is control systems R&D for an automation system.
I have been working there e.g. by utilising both java and Eclipse. Also a very little amount of python.
(And Matlab/Octave)
So maybe the decision was quite straightforward.
My system is Xubuntu 22.04 with Ubuntu Studio installed. So what happened then ?
I wanted to tell about the required steps for those who choose Eclipse as an IDE for java-csound-coding.
(by the way, Eclipse could be utilised also for python-development)
1 Eclipse installation - standard, no problems
2 csnd6.jar
1’st java example (example2) => problems because Eclipse can’t find csnd6.jar.
It turned out that this jar does not automatically come with UStudio but there’s a separate package for that.
I installed and told Eclipse where this library is located
Now the java-code looks correct.
3 Run
Trying to run - no success => (something like)
java.lang.UnsatisfiedLinkError: no native library in java.library.path.
This was not that easy anymore, because the actual location of the related c-code library is
/usr/lib/x86_64-linux-gnu/jni/.
I found the correct location, but how to tell about that to Eclipse, because the normal way with the jar-packages doesn’t succeed ?
Fortunately I found instructions for this at a web-page (by Google) https://javarevisited.blogspot.com/2013/04/what-is-javalibrarypath-how-to-set-in-Eclipse.html#axzz8W5HHEJsO
On that page there’s a chapter that handles how to set native library location:
3 Ways to set java.library.path in Eclipse IDE
Now it is possible to run java-code with the embedded csound-code.
4 cmd-line run
There’s still (at least?) one problem when I try to run the code with the default java-engine from the command-line.
The java-version for that is older that the one in Eclipse, but his should be easy to take to account on the Eclipse-side.