[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

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

Looks like we need an overload of fillarray for audio variables.

Thanks!

And most logical would be to have 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.

WarningThis 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

That’s done now. Tested with

asig[] diskin “fox.wav”
clear asig