Csound Csound-dev Csound-tekno Search About

[Cs-dev] plugin opcode problem..

Date2009-10-22 14:46
FromRory Walsh
Subject[Cs-dev] plugin opcode problem..
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@lists.sourceforge.net

Date2009-10-22 14:51
FromAndres Cabrera
SubjectRe: [Cs-dev] plugin opcode problem..
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  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@lists.sourceforge.net
> 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@lists.sourceforge.net

Date2009-10-22 15:13
FromVictor Lazzarini
SubjectRe: [Cs-dev] plugin opcode problem..
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@lists.sourceforge.net
> 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@lists.sourceforge.net

Date2009-10-22 15:37
FromRory Walsh
SubjectRe: [Cs-dev] plugin opcode problem..
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 :
> 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@lists.sourceforge.net
>> 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@lists.sourceforge.net
> 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@lists.sourceforge.net

Date2009-10-22 15:39
FromMichael Gogins
SubjectRe: [Cs-dev] plugin opcode problem..
csound->GetKsmps(csound)

Regards,
Mike

On 10/22/09, 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@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

------------------------------------------------------------------------------
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@lists.sourceforge.net

Date2009-10-22 17:05
FromVictor Lazzarini
SubjectRe: [Cs-dev] plugin opcode problem..
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 :
>> 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@lists.sourceforge.net
>>> 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@lists.sourceforge.net
>> 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@lists.sourceforge.net
> 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@lists.sourceforge.net

Date2009-10-22 17:16
FromRory Walsh
SubjectRe: [Cs-dev] plugin opcode problem..
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 :
> 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@lists.sourceforge.net