Csound Csound-dev Csound-tekno Search About

[Csnd-dev] i/k/a in functional syntax

Date2019-03-11 09:45
Fromjoachim heintz
Subject[Csnd-dev] i/k/a in functional syntax
when i write
(1)	kVal random 0, 1
i get a different random value for every k-cycle.

but when i write
(2)	kVal = random(0,1)
i only get one random value, because the random opcode is called in its 
i-time variant.

i have to write explicitely
(3)	kVal = random:k(0,1)
to bring it to the same result as (1).

is there any possibility that the parser considers the variable rate (in 
this case *k*Val) and chooses the appropriate rate of the opcode after it?

Date2019-03-11 10:55
FromEduardo Moguillansky
SubjectRe: [Csnd-dev] i/k/a in functional syntax
When written in non-functional style, the parser dispatches on both the 
input and output args. It has access to the output variable and, based 
on its type, it can pick which version of "random" fits the types. When 
writing in functional style the parser, in its current state, has no 
access to the type of its output.

On Mo, Mar 11, 2019 at 10:45 AM, joachim heintz  
wrote:
> when i write
> (1)	kVal random 0, 1
> i get a different random value for every k-cycle.
> 
> but when i write
> (2)	kVal = random(0,1)
> i only get one random value, because the random opcode is called in 
> its i-time variant.
> 
> i have to write explicitely
> (3)	kVal = random:k(0,1)
> to bring it to the same result as (1).
> 
> is there any possibility that the parser considers the variable rate 
> (in this case *k*Val) and chooses the appropriate rate of the opcode 
> after it?
> 

Date2019-03-11 13:35
Fromjoachim heintz
SubjectRe: [Csnd-dev] i/k/a in functional syntax
i see --- thanks for explaining!
	j



On 11/03/19 11:55, Eduardo Moguillansky wrote:
> When written in non-functional style, the parser dispatches on both the
> input and output args. It has access to the output variable and, based
> on its type, it can pick which version of "random" fits the types. When
> writing in functional style the parser, in its current state, has no
> access to the type of its output.
>
> On Mo, Mar 11, 2019 at 10:45 AM, joachim heintz 
> wrote:
>> when i write
>> (1)    kVal random 0, 1
>> i get a different random value for every k-cycle.
>>
>> but when i write
>> (2)    kVal = random(0,1)
>> i only get one random value, because the random opcode is called in
>> its i-time variant.
>>
>> i have to write explicitely
>> (3)    kVal = random:k(0,1)
>> to bring it to the same result as (1).
>>
>> is there any possibility that the parser considers the variable rate
>> (in this case *k*Val) and chooses the appropriate rate of the opcode
>> after it?
>>
>>     joachim