Csound Csound-dev Csound-tekno Search About

[Csnd] how to clear/zera a-array

Date2022-01-10 08:46
FromTarmo Johannes
Subject[Csnd] how to clear/zera a-array
Hi!

What is the best way to set all elements of an audio array to 0?

If the array is declared as
gaOutput[] init 10

clear gaOutput
does not work


clear gaOutput[0], gaOutput[1], etc
works but is cumbersome for longer arrays

gaOutput fillarray  0
does not wor with a-arrays.

I am sure there is an elegent way but I cannot find it.

Thanks!
tarmo
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

Date2022-01-10 09:03
From00000008a49663bc-dmarc-request@LISTSERV.HEANET.IE
SubjectRe: [Csnd] how to clear/zera a-array

Hello,

this is not elegant but maybe can be wrapped in a udo

kIndx   =       0
while kIndx < lenarray(aArr) do
aArr[kIndx] = 0 
kIndx = kIndx + 1
od

Il 10/01/2022 09:46 Tarmo Johannes <trmjhnns@gmail.com> ha scritto:


Hi!

What is the best way to set all elements of an audio array to 0?

If the array is declared as
gaOutput[] init 10

clear gaOutput
does not work


clear gaOutput[0], gaOutput[1], etc
works but is cumbersome for longer arrays

gaOutput fillarray  0
does not wor with a-arrays.

I am sure there is an elegent way but I cannot find it.

Thanks!
tarmo
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

Date2022-01-10 09:16
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] how to clear/zera a-array
Looks like we need an overload of fillarray for audio variables.

On 10 Jan 2022, at 08:46, Tarmo Johannes <trmjhnns@GMAIL.COM> 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.
Hi!

What is the best way to set all elements of an audio array to 0?

If the array is declared as
gaOutput[] init 10

clear gaOutput
does not work


clear gaOutput[0], gaOutput[1], etc
works but is cumbersome for longer arrays

gaOutput fillarray  0
does not wor with a-arrays.

I am sure there is an elegent way but I cannot find it.

Thanks!
tarmo
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


Date2022-01-10 09:33
FromTarmo Johannes
SubjectRe: [Csnd] [EXTERNAL] [Csnd] how to clear/zera a-array
Thanks!

And most logical would be to have <clear> zeroing the arrays too.

tarmo

Kontakt Victor Lazzarini (<Victor.Lazzarini@mu.ie>) kirjutas kuupäeval E, 10. jaanuar 2022 kell 11:16:
Looks like we need an overload of fillarray for audio variables.

On 10 Jan 2022, at 08:46, Tarmo Johannes <trmjhnns@GMAIL.COM> 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.
Hi!

What is the best way to set all elements of an audio array to 0?

If the array is declared as
gaOutput[] init 10

clear gaOutput
does not work


clear gaOutput[0], gaOutput[1], etc
works but is cumbersome for longer arrays

gaOutput fillarray  0
does not wor with a-arrays.

I am sure there is an elegent way but I cannot find it.

Thanks!
tarmo
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

Date2022-01-10 11:11
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] how to clear/zera a-array
That's done now.  Tested with

asig[] diskin "fox.wav"
clear asig

On 10 Jan 2022, at 09:33, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:

Thanks!

And most logical would be to have <clear> zeroing the arrays too.

tarmo

Kontakt Victor Lazzarini (<Victor.Lazzarini@mu.ie>) kirjutas kuupäeval E, 10. jaanuar 2022 kell 11:16:
Looks like we need an overload of fillarray for audio variables.

On 10 Jan 2022, at 08:46, Tarmo Johannes <trmjhnns@GMAIL.COM> 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.
Hi!

What is the best way to set all elements of an audio array to 0?

If the array is declared as
gaOutput[] init 10

clear gaOutput
does not work


clear gaOutput[0], gaOutput[1], etc
works but is cumbersome for longer arrays

gaOutput fillarray  0
does not wor with a-arrays.

I am sure there is an elegent way but I cannot find it.

Thanks!
tarmo
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