[Cs-dev] java newbie and csound api - compile error
Date | 2009-08-15 15:06 |
From | peiman |
Subject | [Cs-dev] java newbie and csound api - compile error |
Hello, I am for the first time trying to get my head around java and csoundapi. I am trying to compile and run the SliderDemo.java mentioned in James Hearon's article (http://www.csounds.com/journal/2006summer/SliderDemo.html). However I am getting 2 errors (see bellow) that prevent the .java file from compiling. My platform is osx leopard and I have the lates version of csound installed. Any help would be very much appreciated. Many Thanks Peiman peiman-khosravis-macbook-pro:SliderDemo peimankh$ javac SliderDemo.java SliderDemo.java:180: GetChannelPtr(csnd.SWIGTYPE_p_float,java.lang.String,int) in csnd.Csound cannot be applied to (csnd.SWIGTYPE_p_p_float,java.lang.String,int) if(csound.GetChannelPtr(myfltarray.GetPtr(), "pitch", ^ SliderDemo.java:217: GetChannelPtr(csnd.SWIGTYPE_p_float,java.lang.String,int) in csnd.Csound cannot be applied to (csnd.SWIGTYPE_p_p_float,java.lang.String,int) if(csound.GetChannelPtr(myfltarray.GetPtr(), "pitch", ^ 2 errors -- View this message in context: http://www.nabble.com/java-newbie-and-csound-api---compile-error-tp24984903p24984903.html Sent from the Csound - Dev mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2009-08-15 15:19 |
From | Victor.Lazzarini@nuim.ie |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None None None |
Date | 2009-08-15 15:50 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
Hello, Interestingly the code (http://www.csounds.com/journal/2006summer/SliderDemo.zip) does not include such a declaration at all. Maybe I am missing something. Thanks Peiman |
Date | 2009-08-15 16:04 |
From | victor |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
Not sure what you are talking about. The text you
gave us a link shows on
section IV, this code:
Csound csound = new Csound(); CsoundArgVList args = new CsoundArgVList(); CsoundMYFLTArray myfltarray = new CsoundMYFLTArray(); SWIGTYPE_p_p_float myptr = myfltarray.GetPtr(); int result = csound.Compile(args.argc(), args.argv()); int myinputch = csndConstants.CSOUND_INPUT_CHANNEL; int mycontch = csndConstants.CSOUND_CONTROL_CHANNEL; if (result == 0){ while(csound.PerformKsmps()== 0){ if(csound.GetChannelPtr(myptr, "pitch", myinputch | mycontch ) == 0) myfltarray.SetValue(0, 200.00); } } The errors you reported seem to come from this section and from a mis-typed declaration of myptr. Victor
|
Date | 2009-08-15 16:42 |
From | victor |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
Actually, and this looks strange, GetChannelPtr()
is expecting a
csnd.SWIGTYPE_p_float and you are giving it
csnd.SWIGTYPE_p_p_float
as discussed in the text.
Passing myfltarray.GetPtr(0) would fix that, but to
me it looks wrong.
Victor
|
Date | 2009-08-15 17:49 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
What I meant was that I can't find SWIGTYPE_p_f in the code to change to SWIGTYPE_p_p_float. The code comes straight from the article example without modification, does this mean that there is a mistype in the example code in the article? Peiman On 15 Aug 2009, at 16:04, victor wrote:
|
Date | 2009-08-15 17:52 |
From | victor |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
No, the article looks OK to me. Perhaps something
funny in
the Java wrappers?
|
Date | 2009-08-15 18:04 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
Just to say that I tried it with the double csnd.jar too and the same errors except "float" is changed to "double". Java wrapper problem doesn't sound good :-( Thanks Peiman On 15 Aug 2009, at 17:52, victor wrote:
|
Date | 2009-08-15 18:49 |
From | victor |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
Attachments | None None |
I would not be so fast to come to conclusions. I am
sure there is an
explanation. People are using the Java interface
(eg. AVS) and
it should work.
Victor
|
Date | 2009-08-15 19:03 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Cs-dev] java newbie and csound api - compile error |
> I would not be so fast to come to conclusions. I am sure there is an > explanation. People are using the Java interface (eg. AVS) and > it should work. > > Victor I on the other hand am having great problems with teh Java API Current mess is buried in my incoming mail; will post as soon as I find it ==John ff ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |