Page 1 of 1

Arrays/Lookup-tables in code editor

PostPosted: Fri Jan 05, 2018 5:47 am
by tulamide
Is it possible to feed the code editor with an array?

Having 100s (even if just a dozen) of values that might be changed via green during runtime would be a disaster if fed via stream input 1 by 1.

Re: Arrays/Lookup-tables in code editor

PostPosted: Fri Jan 05, 2018 6:35 am
by martinvicanek
If you want to stay with the DSP codebox and not use ASM, then one way to make large dynamic datasets available is via the wave read prim. That means that you have to split your code into two boxes: one calculating the index which is supplied to the wave read prim, and one which may then use the value provided by the prim.

If your application can "wait" for the data to be loaded "one by one", then that might be a viable alternative. In your post, does "100s" mean "hundreds" or "hundred seconds"?

P.s. Wait, according to the manual, the memin instruction is also available for DSP code. If you want to use memin, however, be prepared for frequent crashes. :mrgreen:

Re: Arrays/Lookup-tables in code editor

PostPosted: Fri Jan 05, 2018 7:47 pm
by tulamide
Thank you, Martin!

After a second read, I admit that I was very lazy, when writing it :lol:
I meant "hundreds", and one by one was meant as the worst case scenario! I think I'm starting to learn the limits of the code editor, and that's a good thing. Trying to achieve something that will only later turn out to be impossible to do with the editor would discourage more than knowing beforehand, what's possible and what not.

Back to easy and simple tasks (I do them to get more used to the editor).