[Csnd] grain syntax error

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] grain syntax error

Marvin Juneyoung Kim
Hello all,

I've been always getting syntax error with grain every time I do some kind of math with parameters. 

Is there any set of rules for doing math with parameters in grain or opcodes in general depending on what kind of signal rate the parameters are written as in the manual?  

These are two things I've tried so far but non of these worked. 

I also included the csd file in the attachment.

Thanks!





--
Best,

Marvin
Csound mailing list [hidden email] 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

MarvinKim_NoteListComposition.zip (2M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] grain syntax error

Dave Seidel
I think maybe you just need to wrap those expressions with i() to ensure that Csound treats the results as an i-params, which is what the opcode expects. 

On Fri, Mar 23, 2018 at 6:18 PM, Marvin Juneyoung Kim <[hidden email]> wrote:
Hello all,

I've been always getting syntax error with grain every time I do some kind of math with parameters. 

Is there any set of rules for doing math with parameters in grain or opcodes in general depending on what kind of signal rate the parameters are written as in the manual?  

These are two things I've tried so far but non of these worked. 

I also included the csd file in the attachment.

Thanks!





--
Best,

Marvin
Csound mailing list [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] grain syntax error

Marvin Juneyoung Kim
I tried changing igdens*(1+adensrand) to both I(gdens*(1+adensrand)) and i(igdens*(1+adensrand))

and now it says error: Use of i() with expression not permitted on line 50



On Fri, Mar 23, 2018 at 6:40 PM, Dave Seidel <[hidden email]> wrote:
I think maybe you just need to wrap those expressions with i() to ensure that Csound treats the results as an i-params, which is what the opcode expects. 

On Fri, Mar 23, 2018 at 6:18 PM, Marvin Juneyoung Kim <[hidden email]> wrote:
Hello all,

I've been always getting syntax error with grain every time I do some kind of math with parameters. 

Is there any set of rules for doing math with parameters in grain or opcodes in general depending on what kind of signal rate the parameters are written as in the manual?  

These are two things I've tried so far but non of these worked. 

I also included the csd file in the attachment.

Thanks!





--
Best,

Marvin
Csound mailing list [hidden email] 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 [hidden email] 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



--
Best,

Marvin
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] grain syntax error

luis jure
In reply to this post by Marvin Juneyoung Kim
el 2018-03-23 a las 18:18 Marvin Juneyoung Kim escribió:

> Is there any set of rules for doing math with parameters in grain or
> opcodes in general depending on what kind of signal rate the parameters
> are written as in the manual?

in the first case, the problem is this:

idens = p7*(1+adens)

you can't just assign a-rate variables (or an expression using a-rate
variables) to an i-rate variable.

in the second case, the problem is not in the mathematical expression
(grain accepts an xarg for the density), but simply that the opcode
requires nine arguments, and you are providing only eight. add the missing
opcode, and your orchestra compiles.

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] grain syntax error

Marvin Juneyoung Kim
Thank you, so can I apply mathematical expression on any parameter that are x arguments on any opcodes?
Is it limited to the xarg parameters?

On Fri, Mar 23, 2018 at 6:56 PM, luis jure <[hidden email]> wrote:
el 2018-03-23 a las 18:18 Marvin Juneyoung Kim escribió:

> Is there any set of rules for doing math with parameters in grain or
> opcodes in general depending on what kind of signal rate the parameters
> are written as in the manual?

in the first case, the problem is this:

idens = p7*(1+adens)

you can't just assign a-rate variables (or an expression using a-rate
variables) to an i-rate variable.

in the second case, the problem is not in the mathematical expression
(grain accepts an xarg for the density), but simply that the opcode
requires nine arguments, and you are providing only eight. add the missing
opcode, and your orchestra compiles.

Csound mailing list
[hidden email]
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



--
Best,

Marvin
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] grain syntax error

luis jure
el 2018-03-23 a las 19:11 Marvin Juneyoung Kim escribió:

> ​Thank you, so can I apply mathematical expression on any parameter that
> are x arguments on any opcodes?
> Is it limited to the xarg parameters?

x admits a, k, and i
k admits k and i
i admits only i






--

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] grain syntax error

Marvin Juneyoung Kim
Thank you, Luis

On Fri, Mar 23, 2018 at 7:14 PM, luis jure <[hidden email]> wrote:
el 2018-03-23 a las 19:11 Marvin Juneyoung Kim escribió:

> ​Thank you, so can I apply mathematical expression on any parameter that
> are x arguments on any opcodes?
> Is it limited to the xarg parameters?

x admits a, k, and i
k admits k and i
i admits only i






--

Csound mailing list
[hidden email]
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



--
Best,

Marvin
Csound mailing list [hidden email] 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