Page 1 of 1

Re-Initialize Array

PostPosted: Thu Nov 01, 2018 11:58 am
by aronb
Hi,

I am trying to write a quick DSP function that needs to use an array. I can initialize the array to be the correct value (float buffer[256] = -0.99) like on page 242? Of the user manual, works fine. I use the array to find the maximum of a set of waves, just read the values into the array with an index. Again works fine.

Now...

I need to re-initialize the array back to a value of -0.99 after I have done this some number of times (in my case 5 times sometimes a few more or less).
I do not see a way to re-initialize the array back to a known number using the standard DSP commands. Think of it like “clear array”. I also tried the “loop(256) { ...(index through array, set to a number)... }” command and that works fine, but I cannot figure out how to only have “loop” work after some number of cycles.
Ideally it would take an external “reset” (streamin reset) and clear the array on command... but again see no way to do that.

So again, how can you re-initialize an array in a DSP program after the first time of initialization?

Thanks for any and all help,

Aron

Re: Re-Initialize Array

PostPosted: Thu Nov 01, 2018 1:53 pm
by martinvicanek
You can't do that in DSP code, but you can do it in ASM. KG has a good ASM tutorial on the FS Guru site. ;)