[Csnd] a-var to k-var assignment

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

[Csnd] a-var to k-var assignment

gsenna

Is this supposed to be valid? It is on 6.09.1.

aVec init 42           ; I tried vaset at perf-time and it also works.

kControl = aVec    ; Downsampling error?

printk2 kControl    ; kControl = 42.0000


Cheers!

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] a-var to k-var assignment

rorywalsh
Hi Guillermo. I'm not sure if this is now valid, but you can use always the downsamp opcode.
https://csound.github.io/docs/manual/downsamp.html

On 17 September 2017 at 21:21, Guillermo Senna <[hidden email]> wrote:

Is this supposed to be valid? It is on 6.09.1.

aVec init 42           ; I tried vaset at perf-time and it also works.

kControl = aVec    ; Downsampling error?

printk2 kControl    ; kControl = 42.0000


Cheers!

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] a-var to k-var assignment

gsenna
Hey Rory,

Thanks for the tip! I'd also read about the k() converter in the new
Springer book, but there I see:

Finally, audio variables and expressions cannot be assigned directly to
control
variables. This is because we are going from many values (the vector),
to a single
one (a scalar).

So either there was a recent change, the book is wrong or the code is wrong.

Cheers!


On 18/09/17 06:50, Rory Walsh wrote:

> Hi Guillermo. I'm not sure if this is now valid, but you can use always the
> downsamp opcode.
> https://csound.github.io/docs/manual/downsamp.html
>
> On 17 September 2017 at 21:21, Guillermo Senna <[hidden email]> wrote:
>
>> Is this supposed to be valid? It is on 6.09.1.
>>
>> aVec init 42           ; I tried vaset at perf-time and it also works.
>>
>> kControl = aVec    ; Downsampling error?
>>
>> printk2 kControl    ; kControl = 42.0000
>>
>>
>> Cheers!
>> 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
>

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] a-var to k-var assignment

Victor Lazzarini-2
In principle, we can't, but the code might have become more permissible. It's probably copying the first element of the vector.

So the book is right, even if the parser is not enforcing it.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 18 Sep 2017, at 20:02, Guillermo Senna <[hidden email]> wrote:
>
> Hey Rory,
>
> Thanks for the tip! I'd also read about the k() converter in the new
> Springer book, but there I see:
>
> Finally, audio variables and expressions cannot be assigned directly to
> control
> variables. This is because we are going from many values (the vector),
> to a single
> one (a scalar).
>
> So either there was a recent change, the book is wrong or the code is wrong.
>
> Cheers!
>
>
>> On 18/09/17 06:50, Rory Walsh wrote:
>> Hi Guillermo. I'm not sure if this is now valid, but you can use always the
>> downsamp opcode.
>> https://csound.github.io/docs/manual/downsamp.html
>>
>>> On 17 September 2017 at 21:21, Guillermo Senna <[hidden email]> wrote:
>>>
>>> Is this supposed to be valid? It is on 6.09.1.
>>>
>>> aVec init 42           ; I tried vaset at perf-time and it also works.
>>>
>>> kControl = aVec    ; Downsampling error?
>>>
>>> printk2 kControl    ; kControl = 42.0000
>>>
>>>
>>> Cheers!
>>> 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
>>
>
> 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] a-var to k-var assignment

gsenna
Thanks, Victor. Indeed, copying the first element is the behaviour I was
observing.


On 18/09/17 16:09, Victor Lazzarini wrote:

> In principle, we can't, but the code might have become more permissible. It's probably copying the first element of the vector.
>
> So the book is right, even if the parser is not enforcing it.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 18 Sep 2017, at 20:02, Guillermo Senna <[hidden email]> wrote:
>>
>> Hey Rory,
>>
>> Thanks for the tip! I'd also read about the k() converter in the new
>> Springer book, but there I see:
>>
>> Finally, audio variables and expressions cannot be assigned directly to
>> control
>> variables. This is because we are going from many values (the vector),
>> to a single
>> one (a scalar).
>>
>> So either there was a recent change, the book is wrong or the code is wrong.
>>
>> Cheers!
>>
>>
>>> On 18/09/17 06:50, Rory Walsh wrote:
>>> Hi Guillermo. I'm not sure if this is now valid, but you can use always the
>>> downsamp opcode.
>>> https://csound.github.io/docs/manual/downsamp.html
>>>
>>>> On 17 September 2017 at 21:21, Guillermo Senna <[hidden email]> wrote:
>>>>
>>>> Is this supposed to be valid? It is on 6.09.1.
>>>>
>>>> aVec init 42           ; I tried vaset at perf-time and it also works.
>>>>
>>>> kControl = aVec    ; Downsampling error?
>>>>
>>>> printk2 kControl    ; kControl = 42.0000
>>>>
>>>>
>>>> Cheers!
>>>> 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
>>>
>> 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

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