Hello all,
I'm looking through the flext documentation and am having trouble figuring out how to send a list of floats. The length of the lists and the number of lists is variable. The floats I will be inserting as a list currently exist as a float array, but the contents would need to be reordered somewhat.
My guess is you first define the vars to store the lists in the class, then use Append in a loop at add the array values to the list, and then send out with ToOutList(). But what variable type should the list variable be?
If anyone has an example around please send it along.
Thanks Ben
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Le 8 Août 2003 11:52, ben@ekran.org a écrit :
My guess is you first define the vars to store the lists in the class, then use Append in a loop at add the array values to the list, and then send out with ToOutList(). But what variable type should the list variable be?
You need an atom list (type "AtomList"), and a atom (type "t_atom"). For each float value, set the atom with the "SetFloat" function, then use the "Append" method to append the atom to the atom list.
- -- Marc
My guess is you first define the vars to store the lists in the class, then use Append in a loop at add the array values to the list, and then send out with ToOutList(). But what variable type should the list variable be?
You need an atom list (type "AtomList"), and a atom (type "t_atom"). For each float value, set the atom with the "SetFloat" function, then use the "Append" method to append the atom to the atom list.
That works but i think i need not mention that you better know the size beforehand..... (AtomList is a primitive container not as powerful as the refined STL class std::vector<t_atom>)
like:
AtomList mylist(size); for(int i = 0; i< size; ++i) SetFloat(mylist[i],2.718*i); ToOutList(0,mylist);
or even more efficiently, if size is a constant
t_atom mylist[SIZE]; for(int i = 0; i< SIZE; ++i) SetFloat(mylist[i],2.718*i); ToOutList(0,SIZE,mylist);
best greetings, Thomas
I'm looking through the flext documentation and am having trouble figuring out how to send a list of floats.
By the way... i'd really like to make the flext documentation/reference more usable since i know it's only a very basic survey. Any more ideas what's lacking or could be made better?
T