Csound Csound-dev Csound-tekno Search About

[Csnd] grain syntax error

Date2018-03-23 22:18
FromMarvin Juneyoung Kim
Subject[Csnd] grain syntax error
AttachmentsScreen Shot 2018-03-23 at 5.49.20 PM.png  Screen Shot 2018-03-23 at 5.44.51 PM.png  MarvinKim_NoteListComposition.zip  
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 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

Date2018-03-23 22:40
FromDave Seidel
SubjectRe: [Csnd] grain syntax error
AttachmentsScreen Shot 2018-03-23 at 5.49.20 PM.png  Screen Shot 2018-03-23 at 5.44.51 PM.png  
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 <jkim872@berklee.edu> 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 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

Date2018-03-23 22:53
FromMarvin Juneyoung Kim
SubjectRe: [Csnd] grain syntax error
AttachmentsScreen Shot 2018-03-23 at 5.49.20 PM.png  Screen Shot 2018-03-23 at 5.44.51 PM.png  
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 <dave.seidel@gmail.com> 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 <jkim872@berklee.edu> 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 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



--
Best,

Marvin
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

Date2018-03-23 22:56
Fromluis jure
SubjectRe: [Csnd] grain syntax error
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
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

Date2018-03-23 23:11
FromMarvin Juneyoung Kim
SubjectRe: [Csnd] grain syntax error
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 <ljc@internet.com.uy> 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
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



--
Best,

Marvin
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

Date2018-03-23 23:14
Fromluis jure
SubjectRe: [Csnd] grain syntax error
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
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

Date2018-03-23 23:19
FromMarvin Juneyoung Kim
SubjectRe: [Csnd] grain syntax error
Thank you, Luis

On Fri, Mar 23, 2018 at 7:14 PM, luis jure <ljc@internet.com.uy> 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
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



--
Best,

Marvin
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