plugin opcode problem..

View: New views
7 Messages — Rating Filter:   Alert me  

plugin opcode problem..

by RoryWalsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can anyone tell me why the following code results in an error saying
too few arguments passed to GetKsmps()? I'm try to create a simple
template for some my students and can't figure why it think GetKsmps
accepts any arguments at all?

#include "csdl.h"

typedef struct _sndWrite {
OPDS h;
MYFLT *outsig;/* output pointer */
MYFLT *insig;/* input */
} sndWrite;

int sndWrite_init(CSOUND *csound, sndWrite *p){
return OK;
}

int sndWrite_process(CSOUND *csound, sndWrite *p)
{
int i;
MYFLT *in = p->insig;
MYFLT *out = p->outsig;

int ksmps = csound->GetKsmps();
for(i=0; i < ksmps; i++){
        out[i] = in[i];
        }
return OK;
}

#define S(x)    sizeof(x)
static OENTRY localops[] = {
{ "sndWrite", S(sndWrite), 4, "a", "a", (SUBR)sndWrite_init, NULL,
(SUBR)sndWrite_process }
};
LINKAGE

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: plugin opcode problem..

by Andres Cabrera :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I haven't looked by I suspect since you are using the CSOUND struct,
you would need to pass a pointer to the current CSOUND struct. You
wouldn't need to if you were using the cpp API.

Cheers,
Andrés

On Thu, Oct 22, 2009 at 2:46 PM, Rory Walsh <rorywalsh@...> wrote:

> Can anyone tell me why the following code results in an error saying
> too few arguments passed to GetKsmps()? I'm try to create a simple
> template for some my students and can't figure why it think GetKsmps
> accepts any arguments at all?
>
> #include "csdl.h"
>
> typedef struct _sndWrite {
> OPDS h;
> MYFLT *outsig;/* output pointer */
> MYFLT *insig;/* input */
> } sndWrite;
>
> int sndWrite_init(CSOUND *csound, sndWrite *p){
> return OK;
> }
>
> int sndWrite_process(CSOUND *csound, sndWrite *p)
> {
> int i;
> MYFLT *in = p->insig;
> MYFLT *out = p->outsig;
>
> int ksmps = csound->GetKsmps();
> for(i=0; i < ksmps; i++){
>        out[i] = in[i];
>        }
> return OK;
> }
>
> #define S(x)    sizeof(x)
> static OENTRY localops[] = {
> { "sndWrite", S(sndWrite), 4, "a", "a", (SUBR)sndWrite_init, NULL,
> (SUBR)sndWrite_process }
> };
> LINKAGE
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>



--


Andrés

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: plugin opcode problem..

by Victor Lazzarini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It's

csound->GetKsmps(csound).

Victor

On 22 Oct 2009, at 14:46, Rory Walsh wrote:

> Can anyone tell me why the following code results in an error saying
> too few arguments passed to GetKsmps()? I'm try to create a simple
> template for some my students and can't figure why it think GetKsmps
> accepts any arguments at all?
>
> #include "csdl.h"
>
> typedef struct _sndWrite {
> OPDS h;
> MYFLT *outsig;/* output pointer */
> MYFLT *insig;/* input */
> } sndWrite;
>
> int sndWrite_init(CSOUND *csound, sndWrite *p){
> return OK;
> }
>
> int sndWrite_process(CSOUND *csound, sndWrite *p)
> {
> int i;
> MYFLT *in = p->insig;
> MYFLT *out = p->outsig;
>
> int ksmps = csound->GetKsmps();
> for(i=0; i < ksmps; i++){
> out[i] = in[i];
> }
> return OK;
> }
>
> #define S(x)    sizeof(x)
> static OENTRY localops[] = {
> { "sndWrite", S(sndWrite), 4, "a", "a", (SUBR)sndWrite_init, NULL,
> (SUBR)sndWrite_process }
> };
> LINKAGE
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: plugin opcode problem..

by RoryWalsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks guy. Can I ask Victor how you get away with it in some of your
opcodes, and also in the code from your extensions to Csound article?

2009/10/22 Victor Lazzarini <Victor.Lazzarini@...>:

> It's
>
> csound->GetKsmps(csound).
>
> Victor
>
> On 22 Oct 2009, at 14:46, Rory Walsh wrote:
>
>> Can anyone tell me why the following code results in an error saying
>> too few arguments passed to GetKsmps()? I'm try to create a simple
>> template for some my students and can't figure why it think GetKsmps
>> accepts any arguments at all?
>>
>> #include "csdl.h"
>>
>> typedef struct _sndWrite {
>> OPDS h;
>> MYFLT *outsig;/* output pointer */
>> MYFLT *insig;/* input */
>> } sndWrite;
>>
>> int sndWrite_init(CSOUND *csound, sndWrite *p){
>> return OK;
>> }
>>
>> int sndWrite_process(CSOUND *csound, sndWrite *p)
>> {
>> int i;
>> MYFLT *in = p->insig;
>> MYFLT *out = p->outsig;
>>
>> int ksmps = csound->GetKsmps();
>> for(i=0; i < ksmps; i++){
>>       out[i] = in[i];
>>       }
>> return OK;
>> }
>>
>> #define S(x)    sizeof(x)
>> static OENTRY localops[] = {
>> { "sndWrite", S(sndWrite), 4, "a", "a", (SUBR)sndWrite_init, NULL,
>> (SUBR)sndWrite_process }
>> };
>> LINKAGE
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart
>> your
>> developing skills, take BlackBerry mobile applications to market and
>> stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@...
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: plugin opcode problem..

by Michael Gogins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

csound->GetKsmps(csound)

Regards,
Mike

On 10/22/09, Rory Walsh <rorywalsh@...> wrote:

> Can anyone tell me why the following code results in an error saying
> too few arguments passed to GetKsmps()? I'm try to create a simple
> template for some my students and can't figure why it think GetKsmps
> accepts any arguments at all?
>
> #include "csdl.h"
>
> typedef struct _sndWrite {
> OPDS h;
> MYFLT *outsig;/* output pointer */
> MYFLT *insig;/* input */
> } sndWrite;
>
> int sndWrite_init(CSOUND *csound, sndWrite *p){
> return OK;
> }
>
> int sndWrite_process(CSOUND *csound, sndWrite *p)
> {
> int i;
> MYFLT *in = p->insig;
> MYFLT *out = p->outsig;
>
> int ksmps = csound->GetKsmps();
> for(i=0; i < ksmps; i++){
> out[i] = in[i];
> }
> return OK;
> }
>
> #define S(x)    sizeof(x)
> static OENTRY localops[] = {
> { "sndWrite", S(sndWrite), 4, "a", "a", (SUBR)sndWrite_init, NULL,
> (SUBR)sndWrite_process }
> };
> LINKAGE
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>


--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: plugin opcode problem..

by Victor Lazzarini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The extensions article might not be up-to-date as it was written at a  
time
when the API was changing quite quickly. But I'm sure my opcodes and
from others all have to use this.

Victpr


On 22 Oct 2009, at 15:37, Rory Walsh wrote:

> Thanks guy. Can I ask Victor how you get away with it in some of your
> opcodes, and also in the code from your extensions to Csound article?
>
> 2009/10/22 Victor Lazzarini <Victor.Lazzarini@...>:
>> It's
>>
>> csound->GetKsmps(csound).
>>
>> Victor
>>
>> On 22 Oct 2009, at 14:46, Rory Walsh wrote:
>>
>>> Can anyone tell me why the following code results in an error saying
>>> too few arguments passed to GetKsmps()? I'm try to create a simple
>>> template for some my students and can't figure why it think GetKsmps
>>> accepts any arguments at all?
>>>
>>> #include "csdl.h"
>>>
>>> typedef struct _sndWrite {
>>> OPDS h;
>>> MYFLT *outsig;/* output pointer */
>>> MYFLT *insig;/* input */
>>> } sndWrite;
>>>
>>> int sndWrite_init(CSOUND *csound, sndWrite *p){
>>> return OK;
>>> }
>>>
>>> int sndWrite_process(CSOUND *csound, sndWrite *p)
>>> {
>>> int i;
>>> MYFLT *in = p->insig;
>>> MYFLT *out = p->outsig;
>>>
>>> int ksmps = csound->GetKsmps();
>>> for(i=0; i < ksmps; i++){
>>>       out[i] = in[i];
>>>       }
>>> return OK;
>>> }
>>>
>>> #define S(x)    sizeof(x)
>>> static OENTRY localops[] = {
>>> { "sndWrite", S(sndWrite), 4, "a", "a", (SUBR)sndWrite_init, NULL,
>>> (SUBR)sndWrite_process }
>>> };
>>> LINKAGE
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart
>>> your
>>> developing skills, take BlackBerry mobile applications to market and
>>> stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register  
>>> now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@...
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart  
>> your
>> developing skills, take BlackBerry mobile applications to market  
>> and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@...
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@...
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

Re: plugin opcode problem..

by RoryWalsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm seeing things today, apart from your article I thought I spotted
some other instances of it. Another look the source over confirms
you're all correct, csound->GetKsmps(csound) it is..

2009/10/22 Victor Lazzarini <Victor.Lazzarini@...>:
> The extensions article might not be up-to-date as it was written at a
> time

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel