how to interleave a single symbol in a list?
how to interleave a single symbol (,) in a list?
1 2 3 4 5 .../... to 1, 2, 3, 4, 5 .../...
my max is a bit rusty, so there might be a more efficient/shorter solution, but you can use iter/zl group, like that :
exactly that! thank you very much
there is also an [iter] object, but [zl iter 1] looks somehow more sexy.
Hi manmusic,
I think this is somewhat of a misuse of lists in Max : a list, when written in a message box and clicked is iterating its elements, so you cannot really "lace" them the way you do. (More generally, it is not a good idea to format a message-box content if you plan to process this content as data.)
If you want to lace your two lists as 2-elements couples, you can do it this way:
And btw, you can copy-compress your patch to post them, it's easier to copy them ;)
HTH
Vincent
Thank you Vincent. But that doesn't correspond situation. I need to interleave my two lists to send it to the object object. Arguments must be separated by a comma (1 1.0, 2 2.0, ... / ...). I can't place the comma in the right place in my final list!
Which object are you dealing with ?
Do you really need to pass it through a message-box ?
If you provide some more context for your patch, I might give you a better answer...
...
also, please copy-compressed you patch when you post it here ! :)
Is that what you're trying to do ?
This is a big part of the project. The data from the function object then goes to an arduino.
ok, but when do you eventually need to connect your message box to another object ?
It is not connected in your patch...
Trying to plot the data from the dict ?
Thank you vincent! This is exactly what I was looking for
Excuse me Vincent but I realize that I am missing something. The function object should be on a domain of at least "168981" and not "24". Function is used to control servo motors. On a rail. I need a great fluidity of movement on a displacement of 1'49 ". I would need 7347 steps between each coordinate. I still can't find the solution.
the objective is to simulate the sea tide movements of a day between two shores in 1 minute 49 seconds.
the line object doesn't interest me. I want to be able to control the transport.
"24" is just the size of the array storing the data in your patch (and is dynamically set by zl len, in the case this size changes).
You may indeed need to scale your data to match the range of your {performance duration, servo motor control range, whatever process}.
If you need a finer-grain control, you may also need to upsample your data, for which the simplest option I can think of would be simply to interpolate linearly between 2 adjacent values.
BTW, the "function" object is doing that for you (the "produce interpolated y for this x at left outlet" comment in the help patcher.)
It bothers me. The data in the "Dic" are sea levels over a period of 24 hours.
I'm trying to see if there are solutions with "RegExp".
I'm having trouble with PERL (I'm finding out. I'm not sure this is the right solution to interweave two lists and integrate a comma in the right place). Maybe I should try it in Javascript, but I don't know enough about the language. "sfpring" is limited in entry.
In short, I want to be able to vary my X / Y coordinates (Sea height on time upstream).
Intertwine them to give X/y and followed by a comma seems to me the most direct method. But I can not.
this is as simple as it could be ...
zl lace should output list as is.
then zl iter 2 and append comma