Csound Csound-dev Csound-tekno Search About

[Cs-dev] Java API

Date2009-08-24 15:34
Fromjpff
Subject[Cs-dev] Java API
I am getting very frustrated with this.  We apparently distribute code
with zero documentation and zero examples; and no one in teh developer
community understands it either


All I am trying tp do is have two csound instances, one generating audio
and one consuming.  I read audio from a channel and write it to a
channel.  Latest version is

		SWIGTYPE_p_p_double audio;
		SWIGTYPE_p_p_double audio1;
		CsoundMYFLTArray auxBuffer(100);
.....


		csound.GetChannelPtr(audio, "audio", 34);
		      System.err.println("Point J");

		mixer.GetChannelPtr(audio1, "chn"+ac,18);
		      System.err.println("Point K");

		      /*for(int i=0; i<4*440; i++){
			//Creators
			//Any new parameters
                        csound.PerformKsmps();
                        for (j=0; j<100; j++) {
                            auxBuffer.SetValue(j, audio.bbb);
                            audio1.XXX(auxBuffer.GetValue(j));
                        }
                        mixer.PerformKsmps();
			}*/


But I hav no idea what XXX and bbb shoudl be or the types of any o this
stuff.  It seems to me that the channels are useless.  The numbered
channel that I would prefer just crashes

Is it really the case that no one understands Java?

Yours in deep frustration

==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

Date2009-08-24 15:52
FromSteven Yi
SubjectRe: [Cs-dev] Java API
Hi John,

Sorry I've been terribly busy; I'll try taking a look today.

Steven

On 8/24/09, jpff  wrote:
> I am getting very frustrated with this.  We apparently distribute code
> with zero documentation and zero examples; and no one in teh developer
> community understands it either
>
>
> All I am trying tp do is have two csound instances, one generating audio
> and one consuming.  I read audio from a channel and write it to a
> channel.  Latest version is
>
> 		SWIGTYPE_p_p_double audio;
> 		SWIGTYPE_p_p_double audio1;
> 		CsoundMYFLTArray auxBuffer(100);
> .....
>
>
> 		csound.GetChannelPtr(audio, "audio", 34);
> 		      System.err.println("Point J");
>
> 		mixer.GetChannelPtr(audio1, "chn"+ac,18);
> 		      System.err.println("Point K");
>
> 		      /*for(int i=0; i<4*440; i++){
> 			//Creators
> 			//Any new parameters
>                         csound.PerformKsmps();
>                         for (j=0; j<100; j++) {
>                             auxBuffer.SetValue(j, audio.bbb);
>                             audio1.XXX(auxBuffer.GetValue(j));
>                         }
>                         mixer.PerformKsmps();
> 			}*/
>
>
> But I hav no idea what XXX and bbb shoudl be or the types of any o this
> stuff.  It seems to me that the channels are useless.  The numbered
> channel that I would prefer just crashes
>
> Is it really the case that no one understands Java?
>
> Yours in deep frustration
>
> ==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
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

-- 
Sent from my mobile device

------------------------------------------------------------------------------
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-24 16:33
FromMichael Gogins
SubjectRe: [Cs-dev] Java API
As I mentioned to you Peter Brinkmann uses the Java Csound API to
produce sound for JReality. Did you look at the code I sent you?

Regards,
Mike

On 8/24/09, jpff  wrote:
> I am getting very frustrated with this.  We apparently distribute code
> with zero documentation and zero examples; and no one in teh developer
> community understands it either
>
>
> All I am trying tp do is have two csound instances, one generating audio
> and one consuming.  I read audio from a channel and write it to a
> channel.  Latest version is
>
> 		SWIGTYPE_p_p_double audio;
> 		SWIGTYPE_p_p_double audio1;
> 		CsoundMYFLTArray auxBuffer(100);
> .....
>
>
> 		csound.GetChannelPtr(audio, "audio", 34);
> 		      System.err.println("Point J");
>
> 		mixer.GetChannelPtr(audio1, "chn"+ac,18);
> 		      System.err.println("Point K");
>
> 		      /*for(int i=0; i<4*440; i++){
> 			//Creators
> 			//Any new parameters
>                         csound.PerformKsmps();
>                         for (j=0; j<100; j++) {
>                             auxBuffer.SetValue(j, audio.bbb);
>                             audio1.XXX(auxBuffer.GetValue(j));
>                         }
>                         mixer.PerformKsmps();
> 			}*/
>
>
> But I hav no idea what XXX and bbb shoudl be or the types of any o this
> stuff.  It seems to me that the channels are useless.  The numbered
> channel that I would prefer just crashes
>
> Is it really the case that no one understands Java?
>
> Yours in deep frustration
>
> ==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
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>


-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot 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-24 16:56
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] Java API
> As I mentioned to you Peter Brinkmann uses the Java Csound API to
> produce sound for JReality. Did you look at the code I sent you?
>
> Regards,
> Mike
>

Yes I did; I do not understand it in detail and it does not answer the
question of how to read and write audio from a channel.  The types look
all wrong from what little I can understand from the class files for
GetChannelPtr and it is very unclear how to access the data from the ptr


------------------------------------------------------------------------------
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-24 17:37
FromSteven Yi
SubjectRe: [Cs-dev] Java API
HI John,

I'm looking at cs_glue.cpp and cs_glue.hpp in the interfaces
directory. It looks like CsoundMYFLTArray is actually an array of
arrays, and you should use it with the constructor to determine how
many MYFLT arrays you want.  So maybe use:

CsoundMYFLTArray myfltArray = new CsoundMYFLTArray(2);
myfltArray.GetPtr(0)

GetPtr returns a SWIGTYPE_p_float that I think you use to pass into
GetChannelPtr.  After that, I think you can use this static method
csnd.csnd.sigcpy(myfltArray.GetPtr(0),myfltArray.GetPtr(1), x) but I
haven't found where sigcpy is defined yet.  That should copy the
values from one SWIGTYPE_p_double to the other.

We may want to look at adding some more methods to cs_glue.cpp and
cs_glue.hpp to covert values from a MYFLT* to double[] and back.
Perhaps should would make getting SWIG to be more "native" in feel and
we would have to use the SWIGTYPE_p_double so much.

steven

On Mon, Aug 24, 2009 at 11:56 AM,  wrote:
>> As I mentioned to you Peter Brinkmann uses the Java Csound API to
>> produce sound for JReality. Did you look at the code I sent you?
>>
>> Regards,
>> Mike
>>
>
> Yes I did; I do not understand it in detail and it does not answer the
> question of how to read and write audio from a channel.  The types look
> all wrong from what little I can understand from the class files for
> GetChannelPtr and it is very unclear how to access the data from the ptr
>
>
> ------------------------------------------------------------------------------
> 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

Date2009-08-24 18:25
FromMichael Gogins
SubjectRe: [Cs-dev] Java API
OK, thanks for the info.

As Steven Yi suggests, we can add to the API methods to simplify this
kind of thing. Basically, everywhere that the Csound API exposes a
buffer, we should add an API function to get and set the elements of
that buffer. Then all will be much simpler. I'm reasonably confident I
could get the Java code that exists to work, since I think the code
would be close to what Peter and I did, but I think it would be better
to add these convenience methods.

Regards,
Mike

On 8/24/09, jpff@cs.bath.ac.uk  wrote:
>> As I mentioned to you Peter Brinkmann uses the Java Csound API to
>> produce sound for JReality. Did you look at the code I sent you?
>>
>> Regards,
>> Mike
>>
>
> Yes I did; I do not understand it in detail and it does not answer the
> question of how to read and write audio from a channel.  The types look
> all wrong from what little I can understand from the class files for
> GetChannelPtr and it is very unclear how to access the data from the ptr
>
>
> ------------------------------------------------------------------------------
> 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
>


-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot 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