Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] API: string channels...

Date2006-08-28 23:24
FromVictor Lazzarini
SubjectRe: [Cs-dev] API: string channels...
Would that be a threading issue (I doubt, nevertheless
you can check it)? Try adding the channel code
in the thread function and see if it works.

>
> Hi Victor, I've tried that but no joy. Here is what I try
>
> pd->result = csoundCompile(pd->instance, 2, cmdl);
> my_string =
> (char*)malloc(csoundGetStrVarMaxLen(pd->instance));
> csoundGetChannelPtr(pd->instance, (MYFLT **)&my_string,
> "menu1", CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL);
>
> then whenever a users hits the button it copies a value to
> my_string  using strcpy() but I still only get rubbish. I
> also tested to see if the  rubbish characters change when
> I change the contents of the the string  but they don't,
> they're still the same. I also double checked to make
> sure that "hello" is being written to 'my_string' and it
> most definitely  is. It seems that my main application can
> read the contents of my_string  but csound can't, any
> ideas? Thanks for your help so far.
>
> Rory.
>
>
> Victor Lazzarini wrote:
> > The only thing I can think is that the memory
> > contents of my_string are not "hello\n". You can
> > try, instead, calling the API function just once
> > after compilation, after you allocate memory
> > for your string (you've done that, haven't you?).
> > The memory pointed by my_string and the channel
> > will be connected and you can write to that memory
> > so anything you write there will appear at the channel.
> >
> > Then you can copy the string message
> > to that location at the click of the button.
> >
> > Victor
> >
> >> I just tried to call csoundGetCha.. directly from my
> >> button function. I  create and allocate space for
> >> my_string in my main class constructor but  I still
> only >> see rubbish characters? My OnButtonClick function
> looks >> like this
> >>
> >> void __fastcall TForm1::OnButtonClick(TObject *Sender)
> >> {
> >> csoundGetChannelPtr(pd->instance, (MYFLT **)&my_string,
> >> "menu1", CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL);
> >> strcpy(my_string, "hello\n");
> >> }
> >>
> >> There must be something being assigned to the channel
> as >> the rubbish  characters only appear once I press my
> >> button. If they're was nothing be  sent to the channel
> >> Csound would not be printing anything at all, right?
> >>
> >> Rory.
> >>
> >>
> >> Victor Lazzarini wrote:
> >>> Try to create my_string outside your Set... function,
> >>> passing it to it as a parameter.  In fact you can do
> the >>> csoundGetCh... call outside and then just copy the
> >>> string in your function.
> >>> What the csoundGet.... is doing is linking a channel
> >>> with the string location you created.  Anything
> written >>> into that location will appear on the channel.
> >>>
> >>> At 15:11 28/08/2006, you wrote:
> >>>> Hi Victor, I've just tried your code which as you
> said >> works. I did have >> to cast the result of malloc
> to a >> char*, maybe this is because we are >> using
> different >> compilers? Anyway I then tried it out in a
> GUI >> >> application. I basically modified my previous
> function to >> look like this: >>
> >>>> void SetValueInChannelStr(CSOUND *cs, char *name,
> >> AnsiString string){ >>             char *my_string;
> >>>>             my_string =
> >> (char*)malloc(csoundGetStrVarMaxLen(cs)); >>
> >> int result; >>             result =
> csoundGetChannelPtr(cs >> , (MYFLT **)&my_string, name, >>
> >> CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL); >>
> >>    //change 'hello' to AnsiString string once it
> works... >>>>             if (!result)strcpy(my_string,
> "hello"); >> >>           } >>
> >>>> I have it set up so that SetValueInChannelStr() is
> >> called when I press a >> button. The problem is that
> when >> I run my test instead of "hello" being >> printed
> to the >> screen I get rubbish characters. Any idea why
> this might >>>> be happening? >>
> >>>> Rory.
> >>>>
> >>>>
> >>>> Victor Lazzarini wrote:
> >>>>> and here's a simple example that works:
> >>>>>
> >>>>> int main(int argc, char **argv)
> >>>>> {
> >>>>>      CSOUND  *csound;
> >>>>>      char    *fname = NULL;
> >>>>>      int     i, result;
> >>>>>      char *string;
> >>>>>
> >>>>>      /* initialise Csound library */
> >>>>>      csoundInitialize(&argc, &argv, 0);
> >>>>>
> >>>>>      /*  Create Csound. */
> >>>>>      csound = csoundCreate(NULL);
> >>>>>
> >>>>>      string = malloc(csoundGetStrVarMaxLen(csound));
> >>>>>      /*  One complete performance cycle. */
> >>>>>      result = csoundCompile(csound, argc, argv);
> >>>>>      result = csoundGetChannelPtr(csound, (MYFLT
> >> **)&string, "pitch", >>>      CSOUND_INPUT_CHANNEL |
> >> CSOUND_STRING_CHANNEL); >>>       strcpy(string,
> >> "hello\n"); >>>
> >>>>>      while (!result){
> >>>>>        result = csoundPerformKsmps(csound);
> >>>>>      }
> >>>>>      /* delete Csound instance */
> >>>>>      csoundDestroy(csound);
> >>>>>      free(string);
> >>>>>      return (result >= 0 ? 0 : result);
> >>>>> }
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> At 13:10 28/08/2006, you wrote:
> >>>>>> The 'string' argument does not get passed to
> >> csoundGetChannelPtr(), so >>>> csound never gets it.
> >>>>>>
> >>>>>>> }
> >>>>>>>
> >>
> //--------------------------------------------------------
> >> ------ >>>>> void SetValueInChannelStr(CSOUND *cs, char
> >> *name, char* string) >>>>> { >>>>>>>   MYFLT
> *pvalue_tmp; >>>>>>>   int result;
> >>>>>>>   result = csoundGetChannelPtr(cs, &pvalue_tmp,
> name >> , >>>>>   CSOUND_INPUT_CHANNEL |
> CSOUND_STRING_CHANNEL); >>>>>>>   char *pvalue =
> reinterpret_cast> *>(pvalue_tmp); >>>>>   if
> (!result)strcpy(pvalue, "test >> string"); >>>>> }
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>
> ----------------------------------------------------------
> >> --------------- >>>>> Using Tomcat but need to do more?
> >> Need to support web services, security? >>>>> Get stuff
> >> done quickly with pre-integrated technology to make
> your >> job >>>> easier
> >>>>>>> Download IBM WebSphere Application Server v.1.0.1
> >> based on Apache  >> Geronimo
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >>>>>>> _______________________________________________
> >>>>>>> Csound-devel mailing list
> >>>>>>> Csound-devel@lists.sourceforge.net
> >>>>>>>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >>>>>> Victor Lazzarini >>>> Music Technology Laboratory
> >>>>>> Music Department >>>>>> National University of
> Ireland, Maynooth >>>>>>
> >>>>>>
> >>>>>>
> >>
> ----------------------------------------------------------
> >> --------------- >>>> Using Tomcat but need to do more?
> >> Need to support web services, security? >>>> Get stuff
> >> done quickly with pre-integrated technology to make
> your >> job  >> easier
> >>>>>> Download IBM WebSphere Application Server v.1.0.1
> >> based on Apache Geronimo >>>>
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >>>>>> _______________________________________________
> >>>>>> Csound-devel mailing list
> >>>>>> Csound-devel@lists.sourceforge.net
> >>>>>>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >>>>> Victor Lazzarini >>> Music Technology Laboratory
> >>>>> Music Department >>>>> National University of
> Ireland, Maynooth >>>>>
> >>>>>
> >>>>>
> >>
> ----------------------------------------------------------
> >> --------------- >>> Using Tomcat but need to do more?
> Need >> to support web services, security? >>> Get stuff
> done >> quickly with pre-integrated technology to make
> your job >>>> easier >>> Download IBM WebSphere
> Application Server >> v.1.0.1 based on Apache Geronimo >>>
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >>>>> _______________________________________________
> >>>>> Csound-devel mailing list
> >>>>> Csound-devel@lists.sourceforge.net
> >>>>>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >>
> ----------------------------------------------------------
> >> --------------- >> Using Tomcat but need to do more?
> Need >> to support web services, security? >> Get stuff
> done >> quickly with pre-integrated technology to make
> your job >> easier >> Download IBM WebSphere Application
> Server >> v.1.0.1 based on Apache Geronimo >>
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >>>> _______________________________________________
> >>>> Csound-devel mailing list
> >>>> Csound-devel@lists.sourceforge.net
> >>>>
> >>>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >>> Victor Lazzarini Music Technology Laboratory >>> Music
> Department >>> National University of Ireland, Maynooth
> >>>
> >>>
> >>>
> >>
> ----------------------------------------------------------
> >>> --------------- Using Tomcat but need to do more? Need
> >>> to support web services, security? Get stuff done >>
> quickly with pre-integrated technology to make your job
> >>> easier Download IBM WebSphere Application Server
> v.1.0.1 >>> based on Apache Geronimo
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >>> _______________________________________________
> >>> Csound-devel mailing list
> >>> Csound-devel@lists.sourceforge.net
> >>>
> >>>
> >>
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >> >>
> ----------------------------------------------------------
> >> --------------- Using Tomcat but need to do more? Need
> to >> support web services, security? Get stuff done
> quickly >> with pre-integrated technology to make your job
> easier >> Download IBM WebSphere Application Server
> v.1.0.1 based on >> Apache Geronimo
> >>
> >
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >> _______________________________________________
> >> Csound-devel mailing list
> >> Csound-devel@lists.sourceforge.net
> >>
> >
> >
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> ----------------------------------------------------------
> > --------------- Using Tomcat but need to do more? Need
> > to support web services, security? Get stuff done
> quickly with pre-integrated technology to make your job
> > easier Download IBM WebSphere Application Server v.1.0.1
> > based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> >
> >
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ----------------------------------------------------------
> --------------- Using Tomcat but need to do more? Need to
> support web services, security? Get stuff done quickly
> with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on
> Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-28 23:38
FromRory Walsh
SubjectRe: [Cs-dev] API: string channels...
No that doesn't work either. Istvan did say something about a bug, here 
is what he posted a few weeks ago:

"It is also possible that you have run into the bug that was present in
5.02.1 and older versions. In these releases, string variables were not
allocated correctly if the same name space (global, or same instrument)
also used audio rate variables."

Perhaps that's the problem? He did say he submitted a fix. I will try to 
upgrade to the latest possible version tomorrow and see if that works. 
Cheers,

Rory.


Victor Lazzarini wrote:
> Would that be a threading issue (I doubt, nevertheless
> you can check it)? Try adding the channel code
> in the thread function and see if it works.
> 
>> Hi Victor, I've tried that but no joy. Here is what I try
>>
>> pd->result = csoundCompile(pd->instance, 2, cmdl);
>> my_string =
>> (char*)malloc(csoundGetStrVarMaxLen(pd->instance));
>> csoundGetChannelPtr(pd->instance, (MYFLT **)&my_string,
>> "menu1", CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL);
>>
>> then whenever a users hits the button it copies a value to
>> my_string  using strcpy() but I still only get rubbish. I
>> also tested to see if the  rubbish characters change when
>> I change the contents of the the string  but they don't,
>> they're still the same. I also double checked to make
>> sure that "hello" is being written to 'my_string' and it
>> most definitely  is. It seems that my main application can
>> read the contents of my_string  but csound can't, any
>> ideas? Thanks for your help so far.
>>
>> Rory.
>>
>>
>> Victor Lazzarini wrote:
>>> The only thing I can think is that the memory
>>> contents of my_string are not "hello\n". You can
>>> try, instead, calling the API function just once
>>> after compilation, after you allocate memory
>>> for your string (you've done that, haven't you?).
>>> The memory pointed by my_string and the channel
>>> will be connected and you can write to that memory
>>> so anything you write there will appear at the channel.
>>>
>>> Then you can copy the string message
>>> to that location at the click of the button.
>>>
>>> Victor
>>>
>>>> I just tried to call csoundGetCha.. directly from my
>>>> button function. I  create and allocate space for
>>>> my_string in my main class constructor but  I still
>> only >> see rubbish characters? My OnButtonClick function
>> looks >> like this
>>>> void __fastcall TForm1::OnButtonClick(TObject *Sender)
>>>> {
>>>> csoundGetChannelPtr(pd->instance, (MYFLT **)&my_string,
>>>> "menu1", CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL);
>>>> strcpy(my_string, "hello\n");
>>>> }
>>>>
>>>> There must be something being assigned to the channel
>> as >> the rubbish  characters only appear once I press my
>>>> button. If they're was nothing be  sent to the channel
>>>> Csound would not be printing anything at all, right?
>>>>
>>>> Rory.
>>>>
>>>>
>>>> Victor Lazzarini wrote:
>>>>> Try to create my_string outside your Set... function,
>>>>> passing it to it as a parameter.  In fact you can do
>> the >>> csoundGetCh... call outside and then just copy the
>>>>> string in your function.
>>>>> What the csoundGet.... is doing is linking a channel
>>>>> with the string location you created.  Anything
>> written >>> into that location will appear on the channel.
>>>>> At 15:11 28/08/2006, you wrote:
>>>>>> Hi Victor, I've just tried your code which as you
>> said >> works. I did have >> to cast the result of malloc
>> to a >> char*, maybe this is because we are >> using
>> different >> compilers? Anyway I then tried it out in a
>> GUI >> >> application. I basically modified my previous
>> function to >> look like this: >>
>>>>>> void SetValueInChannelStr(CSOUND *cs, char *name,
>>>> AnsiString string){ >>             char *my_string;
>>>>>>             my_string =
>>>> (char*)malloc(csoundGetStrVarMaxLen(cs)); >>
>>>> int result; >>             result =
>> csoundGetChannelPtr(cs >> , (MYFLT **)&my_string, name, >>
>>>> CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL); >>
>>>>    //change 'hello' to AnsiString string once it
>> works... >>>>             if (!result)strcpy(my_string,
>> "hello"); >> >>           } >>
>>>>>> I have it set up so that SetValueInChannelStr() is
>>>> called when I press a >> button. The problem is that
>> when >> I run my test instead of "hello" being >> printed
>> to the >> screen I get rubbish characters. Any idea why
>> this might >>>> be happening? >>
>>>>>> Rory.
>>>>>>
>>>>>>
>>>>>> Victor Lazzarini wrote:
>>>>>>> and here's a simple example that works:
>>>>>>>
>>>>>>> int main(int argc, char **argv)
>>>>>>> {
>>>>>>>      CSOUND  *csound;
>>>>>>>      char    *fname = NULL;
>>>>>>>      int     i, result;
>>>>>>>      char *string;
>>>>>>>
>>>>>>>      /* initialise Csound library */
>>>>>>>      csoundInitialize(&argc, &argv, 0);
>>>>>>>
>>>>>>>      /*  Create Csound. */
>>>>>>>      csound = csoundCreate(NULL);
>>>>>>>
>>>>>>>      string = malloc(csoundGetStrVarMaxLen(csound));
>>>>>>>      /*  One complete performance cycle. */
>>>>>>>      result = csoundCompile(csound, argc, argv);
>>>>>>>      result = csoundGetChannelPtr(csound, (MYFLT
>>>> **)&string, "pitch", >>>      CSOUND_INPUT_CHANNEL |
>>>> CSOUND_STRING_CHANNEL); >>>       strcpy(string,
>>>> "hello\n"); >>>
>>>>>>>      while (!result){
>>>>>>>        result = csoundPerformKsmps(csound);
>>>>>>>      }
>>>>>>>      /* delete Csound instance */
>>>>>>>      csoundDestroy(csound);
>>>>>>>      free(string);
>>>>>>>      return (result >= 0 ? 0 : result);
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> At 13:10 28/08/2006, you wrote:
>>>>>>>> The 'string' argument does not get passed to
>>>> csoundGetChannelPtr(), so >>>> csound never gets it.
>>>>>>>>> }
>>>>>>>>>
>> //--------------------------------------------------------
>>>> ------ >>>>> void SetValueInChannelStr(CSOUND *cs, char
>>>> *name, char* string) >>>>> { >>>>>>>   MYFLT
>> *pvalue_tmp; >>>>>>>   int result;
>>>>>>>>>   result = csoundGetChannelPtr(cs, &pvalue_tmp,
>> name >> , >>>>>   CSOUND_INPUT_CHANNEL |
>> CSOUND_STRING_CHANNEL); >>>>>>>   char *pvalue =
>> reinterpret_cast> *>(pvalue_tmp); >>>>>   if
>> (!result)strcpy(pvalue, "test >> string"); >>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>> ----------------------------------------------------------
>>>> --------------- >>>>> Using Tomcat but need to do more?
>>>> Need to support web services, security? >>>>> Get stuff
>>>> done quickly with pre-integrated technology to make
>> your >> job >>>> easier
>>>>>>>>> Download IBM WebSphere Application Server v.1.0.1
>>>> based on Apache  >> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>>>>>> _______________________________________________
>>>>>>>>> Csound-devel mailing list
>>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>>> Victor Lazzarini >>>> Music Technology Laboratory
>>>>>>>> Music Department >>>>>> National University of
>> Ireland, Maynooth >>>>>>
>>>>>>>>
>> ----------------------------------------------------------
>>>> --------------- >>>> Using Tomcat but need to do more?
>>>> Need to support web services, security? >>>> Get stuff
>>>> done quickly with pre-integrated technology to make
>> your >> job  >> easier
>>>>>>>> Download IBM WebSphere Application Server v.1.0.1
>>>> based on Apache Geronimo >>>>
>>>>
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>>>>> _______________________________________________
>>>>>>>> Csound-devel mailing list
>>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>> Victor Lazzarini >>> Music Technology Laboratory
>>>>>>> Music Department >>>>> National University of
>> Ireland, Maynooth >>>>>
>>>>>>>
>> ----------------------------------------------------------
>>>> --------------- >>> Using Tomcat but need to do more?
>> Need >> to support web services, security? >>> Get stuff
>> done >> quickly with pre-integrated technology to make
>> your job >>>> easier >>> Download IBM WebSphere
>> Application Server >> v.1.0.1 based on Apache Geronimo >>>
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> ----------------------------------------------------------
>>>> --------------- >> Using Tomcat but need to do more?
>> Need >> to support web services, security? >> Get stuff
>> done >> quickly with pre-integrated technology to make
>> your job >> easier >> Download IBM WebSphere Application
>> Server >> v.1.0.1 based on Apache Geronimo >>
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>> Victor Lazzarini Music Technology Laboratory >>> Music
>> Department >>> National University of Ireland, Maynooth
>>>>>
>>>>>
>> ----------------------------------------------------------
>>>>> --------------- Using Tomcat but need to do more? Need
>>>>> to support web services, security? Get stuff done >>
>> quickly with pre-integrated technology to make your job
>>>>> easier Download IBM WebSphere Application Server
>> v.1.0.1 >>> based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>>
>>>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> ----------------------------------------------------------
>>>> --------------- Using Tomcat but need to do more? Need
>> to >> support web services, security? Get stuff done
>> quickly >> with pre-integrated technology to make your job
>> easier >> Download IBM WebSphere Application Server
>> v.1.0.1 based on >> Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>>
>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> ----------------------------------------------------------
>>> --------------- Using Tomcat but need to do more? Need
>>> to support web services, security? Get stuff done
>> quickly with pre-integrated technology to make your job
>>> easier Download IBM WebSphere Application Server v.1.0.1
>>> based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>>
>>>
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ----------------------------------------------------------
>> --------------- Using Tomcat but need to do more? Need to
>> support web services, security? Get stuff done quickly
>> with pre-integrated technology to make your job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on
>> Apache Geronimo
>>
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-29 08:06
Fromjpff@codemist.co.uk
SubjectRe: [Cs-dev] API: string channels...
Istvan did say that he had fixed a bug, but he left no clue as to
where it is, and the fix (if it exists) is only in his C++ code.  Feel
free to mine that to find the fix.
  I did look at some of the changes to allow strings as arguments to
UDOs but I clearly got it wrong as UDOs stopped working in some
cases, so I backed off.  Again, feel free to find the code (I found
code in Engine/insert.c -- xinset and xoutset, and in Engine/otran.c
function parse_opcode_args but there may be more)
==John ffitch

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-29 15:04
FromRory Walsh
SubjectRe: [Cs-dev] API: string channels...
I'll have a look through the C++ sources and see what I can see..... 
from the symptoms described in earlier posts would yourself or Victor 
imagine that this bug is the root of my problems? I'm thinking that the 
problem could also be of my own doing. If my_string is a member of my 
main class is it ok to pass it to csoundGetChannelPtr()? Saying that I 
have also declared it as a global variable outside any class definition 
and that too causes problems...

Rory.

jpff@codemist.co.uk wrote:
> Istvan did say that he had fixed a bug, but he left no clue as to
> where it is, and the fix (if it exists) is only in his C++ code.  Feel
> free to mine that to find the fix.
>   I did look at some of the changes to allow strings as arguments to
> UDOs but I clearly got it wrong as UDOs stopped working in some
> cases, so I backed off.  Again, feel free to find the code (I found
> code in Engine/insert.c -- xinset and xoutset, and in Engine/otran.c
> function parse_opcode_args but there may be more)
> ==John ffitch
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-29 15:10
FromVictor Lazzarini
SubjectRe: [Cs-dev] API: string channels...
I wouldn't think so, since the C test program was also working
with the same CSD.

At 15:04 29/08/2006, you wrote:
>I'll have a look through the C++ sources and see what I can see.....
>from the symptoms described in earlier posts would yourself or Victor
>imagine that this bug is the root of my problems? I'm thinking that the
>problem could also be of my own doing. If my_string is a member of my
>main class is it ok to pass it to csoundGetChannelPtr()? Saying that I
>have also declared it as a global variable outside any class definition
>and that too causes problems...
>
>Rory.
>
>jpff@codemist.co.uk wrote:
> > Istvan did say that he had fixed a bug, but he left no clue as to
> > where it is, and the fix (if it exists) is only in his C++ code.  Feel
> > free to mine that to find the fix.
> >   I did look at some of the changes to allow strings as arguments to
> > UDOs but I clearly got it wrong as UDOs stopped working in some
> > cases, so I backed off.  Again, feel free to find the code (I found
> > code in Engine/insert.c -- xinset and xoutset, and in Engine/otran.c
> > function parse_opcode_args but there may be more)
> > ==John ffitch
> >
> > -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job 
> easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-30 15:55
FromRory Walsh
SubjectRe: [Cs-dev] API: string channels...
I've now recreated the project using the MinGW compiler and the 
wxWidgets library. Unfortunately I still have problems, only this time I 
don't get any rubbish characters, instead I don't get any at all. My 
play handler looks like this

void wxBASIC::OnPlay(wxCommandEvent &event)
{
   cmdl[0] = "csound";
   cmdl[1] = "basic.csd";
   ud->csound=csoundCreate(NULL);
   csoundSetMessageCallback(ud->csound, csoundMessageCall);
   ud->PERF_STATUS=1;
   ud->result=csoundCompile(ud->csound,2,cmdl);
   threadID = csoundCreateThread(csThread, (void *)ud);
   csoundGetChannelPtr(ud->csound, (MYFLT **)&string, "pitch",
   CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL);
}

The string variable has been created and has had memory allocated to it 
in my constructor. My test button handler simply calls this line of code

strcpy(string, "hello\n");

But I get nothing. If I change CSOUND_STRING_CHANNEL to 
CSOUND_CONTROL_CHANNEL and pass a float on the channel named 'pitch' it 
works fine as one would expect. Any other ideas?

Rory.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-31 10:14
FromRory Walsh
Subject[Cs-dev] Creating import library from dll...
I just tried to create an import library from the latest csound dll and 
when I run pexports to create a def file like this

pexports -o csound32.dll.5.1 > csound32.def

I get the following message:

pexports: csounds32.dll.5.1: could not load PE image

with the resultant .def file completely empty. This always worked 
before, any ideas why it doesn't work now?

Rory.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-08-31 19:44
FromRory Walsh
SubjectRe: [Cs-dev] API: string channels...
Hi Victor, as you might have seen from one of my earlier post I was able 
to recreate the same problems using wxWidgets and the MinGW compiler. 
I'm now getting rid of all GUI stuff but still using classes to see 
where exactly the errors start to take place. The following code results 
in a crash, can you see why? Once this work I will try to call the 
channelPtr function and see if I can this to work at least. Attached is 
the code, a crash occurs whenever I call csoundPerformKsmps()
I have tried to call the function from outside the thread and it still 
causes a crash, any ideas? Probably something stupid. By the way I'm all 
set to start my PhD. Funds are in place and I got a letter from the 
registration office this morning. Yikes...

#include 
#include "csound.hpp"
#include 

using namespace std;
uintptr_t csThread(void *clientData);

struct userData {
int result;
CSOUND* csound;
bool PERF_STATUS;
};

class testClass{
       public:
       void SetString(char* string);
       testClass(int argc, char **argv);
       ~testClass();
       void* threadID;
       void PlayCsound();
       CSOUND  *csound;
       char    *fname;
       int     i, result;
       char *string;
       userData* ud;
       };
//----------------------------------
testClass::testClass(int argc, char **argv)
{
      csoundInitialize(&argc, &argv, 0);
      csound = csoundCreate(NULL);
      result = csoundCompile(csound, argc, argv);
      string = (char*)malloc(csoundGetStrVarMaxLen(csound));
      ud = (userData *) malloc(sizeof(userData));
}
//----------------------------------
testClass::~testClass()
{
      csoundDestroy(csound);
}
//---------------------------------
void testClass::PlayCsound()
{
       ud->PERF_STATUS=1;
       threadID = csoundCreateThread(csThread, (void*)ud);
}
//----------------------------------
void testClass::SetString(char* string)
{
       result = csoundGetChannelPtr(csound, (MYFLT **)&string, "pitch",
       CSOUND_INPUT_CHANNEL | CSOUND_STRING_CHANNEL);
       strcpy(string, "goodbye\n");
}
//----------main------------------
int main(int argc, char **argv)
{
       testClass* test;
       test = new testClass(argc, argv);
       test->PlayCsound();
       getch();
       //test->SetString("test");
}
//--------------------------------------------------------------
uintptr_t csThread(void *data)
{
userData* udata = (userData*)data;
      if(!udata->result)
        {
              while((csoundPerformKsmps(udata->csound) == 
0)&&(udata->PERF_STATUS==1));
        }
      udata->PERF_STATUS=0;
      return 1;
}
//---------------------------------

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-09-19 07:47
Fromjpff
SubjectRe: [Cs-dev] API: string channels...
I implemented Istvan's strings as arguments to UDOs -- seems OK
==John ffitch

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net