Csound Csound-dev Csound-tekno Search About

[Csnd] string in / out parameters in plugins

Date2019-11-15 13:18
Frommichel RODRIGUEZ
Subject[Csnd] string in / out parameters in plugins
Hi there
I'd trying to pass string parameters to a custom plugins, but i don't see any way to interact with char arrays in the plugin structure : 

typedef struct {
  OPDS h;
  MYFLT *out;
  MYFLT *in1, *in2; 
} jsyxloader ;

I tried to cast MYFLT, replaced it by char*, but nothing seems to work (get garbage or crash. Is there an example somewhere or somebody know how to do this ? 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-11-15 13:24
FromEduardo Moguillansky
SubjectRe: [Csnd] string in / out parameters in plugins
typedef struct {
   OPDS h;
   MYFLT *out;
   MYFLT *in1;
   STRINGDAT *instr;
} jsyxloader ;

then you can read the contents of instr

int32_t myplugin_perf(CSOUND *csound, jsyxload *p) {
     // p->instr->data is a char* and contains a null terminated string
     // p->instr->size contains the size of the allocated memory, NOT the size of the string
}

On 15.11.19 14:18, michel RODRIGUEZ wrote:
> Hi there
> I'd trying to pass string parameters to a custom plugins, but i don't see any way to interact with char arrays in the plugin structure :
>
> typedef struct {
>    OPDS h;
>    MYFLT *out;
>    MYFLT *in1, *in2;
> } jsyxloader ;
>
> I tried to cast MYFLT, replaced it by char*, but nothing seems to work (get garbage or crash. Is there an example somewhere or somebody know how to do this ?
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here