| Hi,
Most plugins are already set to be linked using the LINKAGE macro. Take
a look for instance at:
Opcodes/babo.c
#define S sizeof
static OENTRY localops[] = {
{ "babo", S(BABO), 5, "aa", "akkkiiijj",(SUBR)baboset, NULL,
(SUBR)babo }
};
LINKAGE
Cheers,
Andres
On Fri, 2005-09-02 at 17:04, Iain Duncan wrote:
> Can you point me to an example of this? or show me what it should look
> like?
>
> I suggest that info be added to Victor's paper too. = )
>
> Iain
>
> Steven Yi wrote:
> > Hi Iain,
> >
> > It doesn't look like you have the code to actually register with
> > Csound your opcodes in the library. The simple way to do that is to
> > add the LINKAGE macro after the OENTRY localops[] line. (LINKAGE is
> > defined in csdl.h)
> >
> > steven
> >
> >
> > On 9/2/05, Iain Duncan wrote:
> >
> >>I have been following Victor's excellently written tutorial on making
> >>opcodes. This does need to be updated on csounds.com as it uses ENVIRON
> >>instead of CSOUND in the example, dunno about other changes.
> >>
> >>I seem to have compiled my opcode and made a shared library ok ( myop.so
> >>), but I get a no legal opcode error when I try to use it. Do I perhaps
> >>need to register it differently now? Or do something to make csound find
> >>it? I tried putting it in the root csound5 directory, the Plugins
> >>directory, and the Opcodes directory.
> >>
> >>In the bottom of my C source file I have the registration copied from
> >>the tutorial:
> >>
> >>// stuff to register opcode
> >>static OENTRY localops[] =
> >>{ "myop", sizeof(myop), 3, "k", "k", (SUBR)myop_init,
> >>(SUBR)myop_process_k, NULL };
> >>
> >>Is this perhaps different now, or is this supposed to be somewhere else?
> >>Attached is the C file.
> >>
> >>Thanks
> >>Iain
> >>
> >>
> >>// attempt at my first opcode
> >>// doubles an input signal ( just to make it do something )
> >>
> >>#include "csdl.h"
> >>
> >>// structure definition for my opcode
> >>typedef struct _myop {
> >> OPDS h;
> >> MYFLT *in;
> >> MYFLT *out;
> >> MYFLT var;
> >>
> >>} myop;
> >>
> >>// init function for my opcode, initialize internal vars here
> >>int myop_init ( CSOUND *csound, myop *op )
> >>{
> >> // initialize my internal variables here
> >> op->var = 2;
> >>
> >> // opcode initialization is expected to return OK
> >> return OK;
> >>}
> >>
> >>// a krate process needs to return just one sample
> >>int myop_process_k ( CSOUND *csound, myop *op )
> >>{
> >> // make our output variable
> >> MYFLT result = *(op->in) * op->var;
> >> *(op->out) = result;
> >>
> >> return OK;
> >>}
> >>
> >>
> >>// stuff to register opcode
> >>static OENTRY localops[] =
> >>{ "myop", sizeof(myop), 3, "k", "k", (SUBR)myop_init, (SUBR)myop_process_k, NULL };
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> > -------------------------------------------------------
> > SF.Net email is Sponsored by the Better Software Conference & EXPO
> > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |