[PD] How to create an array in Ofelia

Raphael Isdant raphael.isdant at gmail.com
Sat Aug 22 18:28:54 CEST 2020


Hi Alexandros,

You can write this in an object box, and send a bang to it:

ofelia f;
local tab = ofTable();
for i = 1, 161 do tab[i] = ofRandom(0, 255) end;
return(tab);

Le sam. 22 août 2020 à 17:48, Alexandros <adrcki at gmail.com> a écrit :

> I'm trying to write some Lua scripts in [ofelia] and I don't know how to
> create an array, since arrays in Lua are written with curly brackets,
> which are not allowed in Pd.
>
> For example, I'd like to create an array like this:
>
> local tab = {}
>
> and then populate it like this:
>
> for i=1,161
> do
>     tab[i] = ofRandom(0,255)
> end
>
> Any ideas?
>
>
>
>
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>


-- 
*Raphaël Isdant*
*Creative teacher & interactive **art freelancer*

http://raphaelisdant.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20200822/d9d6d247/attachment-0001.html>


More information about the Pd-list mailing list