Is there a way to do it preserving the zero ? I want to compare two lists that include zeros left and right.
Cheers
-
Convert 0 to symbol
-
@flextUser The list-abs library is useful for such things..... all vanilla abstractions.
[list-compare] gives true/false for the whole list..... although it will work for single floats so you could [unpack] your list if you need to compare item by item.
[compare-any] is the abstraction that does single atom comparison....To answer your question....
[makefilename %d] will convert float 0 to symbol 0
David. -
@whale-av Thanks David! I will take a look at list-abs. There is no way to unpack inside makefilename right? [makefilename %d %d %d]
Martin. -
@flextUser Makefilename just takes a single atom.
[concat] will give the whole list as a symbol if that is what you need....... concat.zip
.......... but since about Pd 0.51 escape characters are added.
I don't know why the backslash suddenly needed to be treated as a legal character..... it's a pita...
David. -
@flextUser Maybe you could [fudiformat] first?
-
@jameslo Very useful ! Thanks. I didn't know about this protocol. That does it.
I'm trying to compare time values from a transport to stored values from a text sequence so I can change parameters at specific times.
I could use [text sequence] alone but my transport behaves like a real performer with IOI variations.
-
I'm curious, are you comparing "sequence time point == transport time point" or ">="?
If >=, wouldn't it be easier to keep them numbers, instead of converting to text? (Prefer the simplest solution that gets the job done: if a and b are numbers, there's "a > b" or there's "convert a and b to strings, with zero padding, and compare ASCII" and it's pretty clear which approach is simpler and less breakable -- oh, and faster.)
hjh
-
It's text from a file.
-
@flextUser Why not just unpack the lists and then compare them? Am I missing something obvious?