Csound Csound-dev Csound-tekno Search About

[Csnd] k-rate woes

Date2020-07-22 21:35
FromAlex Weiss
Subject[Csnd] k-rate woes
The following is an excerpt from an instrument:

aRecIndex line 0, gitablelen/sr, gitablelen
gkRecDur = k(aRecIndex)
; alternatively, can also try gkRecDur downsamp aRecIndex

What surprises me here is that after the first k-cycle gkRecDur is 0. At that point, didn't line already compute ksmps worth of a-rate values, so gkRecDur should be whatever the last-computed value of aRecIndex is?



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

Date2020-07-22 21:58
FromPete Goodeve
SubjectRe: [Csnd] k-rate woes
AttachmentsNone  

Date2020-07-22 22:59
Fromjoachim heintz
SubjectRe: [Csnd] k-rate woes
i would have expected it to calculate the mean of the audio vector, but 
i think you are right:

instr down
  aSig linseg 10, p3, -10
  printk 0, k(aSig)
endin
schedule("down",0,4/kr)

new alloc for instr down:
  i   1 time     0.00000:    10.00000
  i   1 time     0.00018:     5.00000
  i   1 time     0.00036:     0.00000
  i   1 time     0.00054:    -5.00000

	joachim


On 22/07/2020 22:58, Pete Goodeve wrote:
> On Wed, Jul 22, 2020 at 01:35:41PM -0700, Alex Weiss wrote:
>> The following is an excerpt from an instrument:
>>
>> aRecIndex line 0, gitablelen/sr, gitablelen
>> gkRecDur = k(aRecIndex)
>> ; alternatively, can also try gkRecDur downsamp aRecIndex
>>
>> What surprises me here is that after the first k-cycle gkRecDur is 0. At
>> that point, didn't line already compute ksmps worth of a-rate values, so
>> gkRecDur should be whatever the last-computed value of aRecIndex is?
>>
> As the a-rate variable is actually an array of ksmps values,
> doesn't a k-conversion simply take the fir4st value of the array?
> 
> 	-- Pete --
> 
> 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

Date2020-07-23 00:26
FromAlex Weiss
SubjectRe: [Csnd] k-rate woes
I guess that makes sense. For some reason I just thought it would be the last element.

On Wed, Jul 22, 2020 at 1:58 PM Pete Goodeve <pete.goodeve@computer.org> wrote:

As the a-rate variable is actually an array of ksmps values,
doesn't a k-conversion simply take the fir4st value of the array?

        -- Pete --

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

Date2020-07-23 09:37
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] k-rate woes
k() is equivalent to downsample 

{ "k.a",   S(DOWNSAMP),0, 3,      "k",    "ao",   (SUBR)downset,(SUBR)downsamp },


========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Jul 2020, at 22:59, joachim heintz  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> i would have expected it to calculate the mean of the audio vector, but
> i think you are right:
> 
> instr down
> aSig linseg 10, p3, -10
> printk 0, k(aSig)
> endin
> schedule("down",0,4/kr)
> 
> new alloc for instr down:
> i   1 time     0.00000:    10.00000
> i   1 time     0.00018:     5.00000
> i   1 time     0.00036:     0.00000
> i   1 time     0.00054:    -5.00000
> 
>       joachim
> 
> 
> On 22/07/2020 22:58, Pete Goodeve wrote:
>> On Wed, Jul 22, 2020 at 01:35:41PM -0700, Alex Weiss wrote:
>>> The following is an excerpt from an instrument:
>>> 
>>> aRecIndex line 0, gitablelen/sr, gitablelen
>>> gkRecDur = k(aRecIndex)
>>> ; alternatively, can also try gkRecDur downsamp aRecIndex
>>> 
>>> What surprises me here is that after the first k-cycle gkRecDur is 0. At
>>> that point, didn't line already compute ksmps worth of a-rate values, so
>>> gkRecDur should be whatever the last-computed value of aRecIndex is?
>>> 
>> As the a-rate variable is actually an array of ksmps values,
>> doesn't a k-conversion simply take the fir4st value of the array?
>> 
>>      -- Pete --
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&reserved=0
>> Send bugs reports to
>>         https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&reserved=0
>> Discussions of bugs and features can be posted here
>> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&reserved=0
> Send bugs reports to
>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&reserved=0
> 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

Date2020-07-23 10:42
Fromjoachim heintz
SubjectRe: [Csnd] [EXTERNAL] [Csnd] k-rate woes
thanks for the hint.  this means, we *can* get what i thought is the 
default, in adding the window length as second argument for averaging 
the a-signal:

instr down
  aSig linseg 10, p3, -10
  printk 0, k(aSig,ksmps)
endin
schedule("down",0,4/kr)

  i   1 time     0.00000:     7.81250
  i   1 time     0.00018:     2.81250
  i   1 time     0.00036:    -2.18750
  i   1 time     0.00054:    -7.18750

	joachim


On 23/07/2020 10:37, Victor Lazzarini wrote:
> k() is equivalent to downsample
> 
> { "k.a",   S(DOWNSAMP),0, 3,      "k",    "ao",   (SUBR)downset,(SUBR)downsamp },
> 
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 22 Jul 2020, at 22:59, joachim heintz  wrote:
>>
>> *Warning*
>>
>> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>
>> i would have expected it to calculate the mean of the audio vector, but
>> i think you are right:
>>
>> instr down
>> aSig linseg 10, p3, -10
>> printk 0, k(aSig)
>> endin
>> schedule("down",0,4/kr)
>>
>> new alloc for instr down:
>> i   1 time     0.00000:    10.00000
>> i   1 time     0.00018:     5.00000
>> i   1 time     0.00036:     0.00000
>> i   1 time     0.00054:    -5.00000
>>
>>        joachim
>>
>>
>> On 22/07/2020 22:58, Pete Goodeve wrote:
>>> On Wed, Jul 22, 2020 at 01:35:41PM -0700, Alex Weiss wrote:
>>>> The following is an excerpt from an instrument:
>>>>
>>>> aRecIndex line 0, gitablelen/sr, gitablelen
>>>> gkRecDur = k(aRecIndex)
>>>> ; alternatively, can also try gkRecDur downsamp aRecIndex
>>>>
>>>> What surprises me here is that after the first k-cycle gkRecDur is 0. At
>>>> that point, didn't line already compute ksmps worth of a-rate values, so
>>>> gkRecDur should be whatever the last-computed value of aRecIndex is?
>>>>
>>> As the a-rate variable is actually an array of ksmps values,
>>> doesn't a k-conversion simply take the fir4st value of the array?
>>>
>>>       -- Pete --
>>>
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&reserved=0
>>> Send bugs reports to
>>>          https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&reserved=0
>>> Discussions of bugs and features can be posted here
>>>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&reserved=0
>> Send bugs reports to
>>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&reserved=0
>> 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
> 

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

Date2020-07-23 17:25
FromAlex Weiss
SubjectRe: [Csnd] [EXTERNAL] [Csnd] k-rate woes
So is there no way then to get the last element (or, more generally, any other element) of a ksmps array of a-values and assign it to a k-rate variable during the k-cycle it was computed?

On Thu, Jul 23, 2020, 01:37 Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
k() is equivalent to downsample

{ "k.a",   S(DOWNSAMP),0, 3,      "k",    "ao",   (SUBR)downset,(SUBR)downsamp },


========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Jul 2020, at 22:59, joachim heintz <jh@joachimheintz.de> wrote:
>
> *Warning*
>
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>
> i would have expected it to calculate the mean of the audio vector, but
> i think you are right:
>
> instr down
> aSig linseg 10, p3, -10
> printk 0, k(aSig)
> endin
> schedule("down",0,4/kr)
>
> new alloc for instr down:
> i   1 time     0.00000:    10.00000
> i   1 time     0.00018:     5.00000
> i   1 time     0.00036:     0.00000
> i   1 time     0.00054:    -5.00000
>
>       joachim
>
>
> On 22/07/2020 22:58, Pete Goodeve wrote:
>> On Wed, Jul 22, 2020 at 01:35:41PM -0700, Alex Weiss wrote:
>>> The following is an excerpt from an instrument:
>>>
>>> aRecIndex line 0, gitablelen/sr, gitablelen
>>> gkRecDur = k(aRecIndex)
>>> ; alternatively, can also try gkRecDur downsamp aRecIndex
>>>
>>> What surprises me here is that after the first k-cycle gkRecDur is 0. At
>>> that point, didn't line already compute ksmps worth of a-rate values, so
>>> gkRecDur should be whatever the last-computed value of aRecIndex is?
>>>
>> As the a-rate variable is actually an array of ksmps values,
>> doesn't a k-conversion simply take the fir4st value of the array?
>>
>>      -- Pete --
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&amp;reserved=0
>> Send bugs reports to
>>         https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&amp;reserved=0
> Send bugs reports to
>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&amp;reserved=0
> 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
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

Date2020-07-23 17:36
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] k-rate woes
yes, of course there is. The simplest is just to use indexing

asig init 0
k1 = asig[ksmps-1]

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Jul 2020, at 17:25, Alex Weiss  wrote:
> 
> So is there no way then to get the last element (or, more generally, any other element) of a ksmps array of a-values and assign it to a k-rate variable during the k-cycle it was computed?
> 
> On Thu, Jul 23, 2020, 01:37 Victor Lazzarini  wrote:
> k() is equivalent to downsample 
> 
> { "k.a",   S(DOWNSAMP),0, 3,      "k",    "ao",   (SUBR)downset,(SUBR)downsamp },
> 
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 22 Jul 2020, at 22:59, joachim heintz  wrote:
> > 
> > *Warning*
> > 
> > This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> > 
> > i would have expected it to calculate the mean of the audio vector, but
> > i think you are right:
> > 
> > instr down
> > aSig linseg 10, p3, -10
> > printk 0, k(aSig)
> > endin
> > schedule("down",0,4/kr)
> > 
> > new alloc for instr down:
> > i   1 time     0.00000:    10.00000
> > i   1 time     0.00018:     5.00000
> > i   1 time     0.00036:     0.00000
> > i   1 time     0.00054:    -5.00000
> > 
> >       joachim
> > 
> > 
> > On 22/07/2020 22:58, Pete Goodeve wrote:
> >> On Wed, Jul 22, 2020 at 01:35:41PM -0700, Alex Weiss wrote:
> >>> The following is an excerpt from an instrument:
> >>> 
> >>> aRecIndex line 0, gitablelen/sr, gitablelen
> >>> gkRecDur = k(aRecIndex)
> >>> ; alternatively, can also try gkRecDur downsamp aRecIndex
> >>> 
> >>> What surprises me here is that after the first k-cycle gkRecDur is 0. At
> >>> that point, didn't line already compute ksmps worth of a-rate values, so
> >>> gkRecDur should be whatever the last-computed value of aRecIndex is?
> >>> 
> >> As the a-rate variable is actually an array of ksmps values,
> >> doesn't a k-conversion simply take the fir4st value of the array?
> >> 
> >>      -- Pete --
> >> 
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&reserved=0
> >> Send bugs reports to
> >>         https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&reserved=0
> >> Discussions of bugs and features can be posted here
> >> 
> > 
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&reserved=0
> > Send bugs reports to
> >       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&reserved=0
> > 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
> 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

Date2020-07-23 18:02
FromAlex Weiss
SubjectRe: [Csnd] [EXTERNAL] [Csnd] k-rate woes
Wow. I had no idea that was a thing. I really gotta read up about all these "new" array features. I feel like a fossil.

On Thu, Jul 23, 2020, 09:36 Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, of course there is. The simplest is just to use indexing

asig init 0
k1 = asig[ksmps-1]

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Jul 2020, at 17:25, Alex Weiss <alexweiss86@GMAIL.COM> wrote:
>
> So is there no way then to get the last element (or, more generally, any other element) of a ksmps array of a-values and assign it to a k-rate variable during the k-cycle it was computed?
>
> On Thu, Jul 23, 2020, 01:37 Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> k() is equivalent to downsample
>
> { "k.a",   S(DOWNSAMP),0, 3,      "k",    "ao",   (SUBR)downset,(SUBR)downsamp },
>
>
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
> > On 22 Jul 2020, at 22:59, joachim heintz <jh@joachimheintz.de> wrote:
> >
> > *Warning*
> >
> > This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> >
> > i would have expected it to calculate the mean of the audio vector, but
> > i think you are right:
> >
> > instr down
> > aSig linseg 10, p3, -10
> > printk 0, k(aSig)
> > endin
> > schedule("down",0,4/kr)
> >
> > new alloc for instr down:
> > i   1 time     0.00000:    10.00000
> > i   1 time     0.00018:     5.00000
> > i   1 time     0.00036:     0.00000
> > i   1 time     0.00054:    -5.00000
> >
> >       joachim
> >
> >
> > On 22/07/2020 22:58, Pete Goodeve wrote:
> >> On Wed, Jul 22, 2020 at 01:35:41PM -0700, Alex Weiss wrote:
> >>> The following is an excerpt from an instrument:
> >>>
> >>> aRecIndex line 0, gitablelen/sr, gitablelen
> >>> gkRecDur = k(aRecIndex)
> >>> ; alternatively, can also try gkRecDur downsamp aRecIndex
> >>>
> >>> What surprises me here is that after the first k-cycle gkRecDur is 0. At
> >>> that point, didn't line already compute ksmps worth of a-rate values, so
> >>> gkRecDur should be whatever the last-computed value of aRecIndex is?
> >>>
> >> As the a-rate variable is actually an array of ksmps values,
> >> doesn't a k-conversion simply take the fir4st value of the array?
> >>
> >>      -- Pete --
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&amp;reserved=0
> >> Send bugs reports to
> >>         https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&amp;reserved=0
> >> Discussions of bugs and features can be posted here
> >>
> >
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=KioKKvr7k3CvpdyGP6B2aluQhGJ9TTWmilkSDcmj7Gg%3D&amp;reserved=0
> > Send bugs reports to
> >       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C992f7e7a2d9448f67fbf08d82e8a7885%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637310519544485196&amp;sdata=pTri4c01SF%2FpHAtXaQmHIwDv7DDd7wSIp8JI38B9CA4%3D&amp;reserved=0
> > 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
> 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
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