Csound Csound-dev Csound-tekno Search About

[Cs-dev] java newbie and csound api - compile error

Date2009-08-15 15:06
Frompeiman
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

Date2009-08-15 15:19
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  None  None  None  

Date2009-08-15 15:50
FromPeiman Khosravi
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray


Date2009-08-15 16:04
Fromvictor
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  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
 
----- Original Message -----
Sent: Saturday, August 15, 2009 3:50 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray


------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2009-08-15 16:42
Fromvictor
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  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
----- Original Message -----
Sent: Saturday, August 15, 2009 3:50 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray


------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2009-08-15 17:49
FromPeiman Khosravi
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  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:

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
 
----- Original Message -----
Sent: Saturday, August 15, 2009 3:50 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray




------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2009-08-15 17:52
Fromvictor
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  None  
No, the article looks OK to me. Perhaps something funny in
the Java wrappers?
----- Original Message -----
Sent: Saturday, August 15, 2009 5:49 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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:

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
 
----- Original Message -----
Sent: Saturday, August 15, 2009 3:50 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray




------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2009-08-15 18:04
FromPeiman Khosravi
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  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:

No, the article looks OK to me. Perhaps something funny in
the Java wrappers?
----- Original Message -----
Sent: Saturday, August 15, 2009 5:49 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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:

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
 
----- Original Message -----
Sent: Saturday, August 15, 2009 3:50 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray




------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel




------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2009-08-15 18:49
Fromvictor
SubjectRe: [Cs-dev] java newbie and csound api - compile error
AttachmentsNone  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
----- Original Message -----
Sent: Saturday, August 15, 2009 6:04 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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:

No, the article looks OK to me. Perhaps something funny in
the Java wrappers?
----- Original Message -----
Sent: Saturday, August 15, 2009 5:49 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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:

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
 
----- Original Message -----
Sent: Saturday, August 15, 2009 3:50 PM
Subject: Re: [Cs-dev] java newbie and csound api - compile error

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


On 15 Aug 2009, at 15:19, Victor.Lazzarini@nuim.ie wrote:

myfltarray




------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel




------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2009-08-15 19:03
Fromjpff@cs.bath.ac.uk
SubjectRe: [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