list filter

Rob's icon

i am using matrices to route data. i just need an object that acts like "sel" but for lists instead of just ints and floats etc. i have tried the match object but to no avail. any ideas? anyone?

Osborne Frit's icon

match didn't work? in what context?

--
robin

Rob's icon

i connect match to the left outlet of matrix and set match to bang on "0 0 0" but it also bangs on 0 1 0. it seems as if it isnt filtering properly.

Rob's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Osborne Frit's icon

hmm. souns like im gonna have to leave this someone more experienced than
me. sorry

--
robin

Osborne Frit's icon

i get that error (assuming it is an error) too. i cant think of any reason
it should do this.
but like i said, im no expert

good luck with that

--
robin

Osborne Frit's icon

a quick fix would be [unpack 0 0 0] into three selects, but its disgustingly
brute force

--
robin

Rob's icon

i dont follow. what do i set sel to?

Osborne Frit's icon

ignore that, you don't need select

you want 0 0 0 to be reported? try:

Max Patch
Copy patch and select New From Clipboard in Max.

--
robin

Stefan Tiedje's icon

Rob wrote:
> i am using matrices to route data. i just need an object that acts
> like "sel" but for lists instead of just ints and floats etc. i have
> tried the match object but to no avail. any ideas? anyone?

Does this work for you?

Max Patch
Copy patch and select New From Clipboard in Max.

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

Stefan Tiedje's icon

Rob wrote:
> i connect match to the left outlet of matrix and set match to bang on
> "0 0 0" but it also bangs on 0 1 0. it seems as if it isnt filtering
> properly.

I can confirm, I think its a bug.
I just looked at the solution I used in my St.==. And there I convert it
to a string before I compare. As shown before this technique would also
work with select and route...

Stefan

St.== for further studies... (this is newer than the version on
c74/share and accepts also lists as arguments.)

Max Patch
Copy patch and select New From Clipboard in Max.

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

Osborne Frit's icon

i take it one of those worked for you then?

--
robin

Rob's icon

stefan, thanks! i am just going to use tosymbol and sel. i cant figure out what that other patch you gave me does. but the using sel with tosymbol works fine.

thanks again.

Roman Thilenius's icon

yes of course; [match] does not know where your
list (= the matrix output) begins.
match _accepts list input, but i can not _tell a
list from many numbers.

connect a [print] to the matrix and you will see.
when you click the first knob twice you send:
"0 0 1, 0 0 0", and 0 0 1 0 0 0 contains 0 1 0 ...

i think you want to [unpack 0 0 0] the lists to
get matrix knob status.

Roman Thilenius's icon

> i think you want to [unpack 0 0 0] the lists to
> get matrix knob status.

actually, what i meant was this.

use [route] to route. [route] routes lists just
fine. (it just cuts off the first element, which
we dont need anyway here.)

then you can use [unpack 0 0] make the on/off item
in the list a bang:

Max Patch
Copy patch and select New From Clipboard in Max.

Osborne Frit's icon

rob

glad to know you appreciated the effort i went to for you.

not one word of acknowledgment for the patch that i took time to prepare as a solution to your problem.
hardly inspires faith in helping others on the list

Rob's icon

sorry, i really do appreciate every one who helps by posting solutions. even though i didnt end up using your solution it is great to know that there are those out in cyber space who care about helping novice programmers.

so to you all...

much thanks and best regards

rob

jasch's icon

ok,
let me advertise my checklist external that does what your looking
for: it compares lists (mixed types).

stephan: your approach to convert any list into a symbol before using
match is dangerous performancewise. imagine having a stream of
numbers coming from a sensor at relatively high speed (~ 10 ms):
you'll have a symbol generation and symboltable lookup for *every*
item you're trying to match, do this in an installation that runs for
months without reboot and your dead.

in the attached patch i'm doing the comparison of the matrix
selection using route like roman proposed, then i'm showing the usage
of the checklist external and i also added a commented abstraction
that will compare two lists item by item iterating through them in
parallel with an uzi.

the last thing i would like to comment on is that these kinds of
things are much easier to do in javascript/java where looping and
comparison functionalities are more comfortable to use.

hth

/*j

> i am using matrices to route data. i just need an object that acts
> like "sel" but for lists instead of just ints and floats etc. i
> have tried the match object but to no avail. any ideas? anyone?

Max Patch
Copy patch and select New From Clipboard in Max.


Rob's icon

jasch, you're saying that if i use stefans tosymbol idea then my cpu will be running too hard. or at least there is an easier way to filter lists?

thanks

rob

jasch's icon

exactly

Stefan Tiedje's icon

/*j wrote:
> stephan: your approach to convert any list into a symbol before using
> match is dangerous performancewise. imagine having a stream of numbers
> coming from a sensor at relatively high speed (~ 10 ms): you'll have a
> symbol generation and symboltable lookup for *every* item you're trying
> to match, do this in an installation that runs for months without
> reboot and your dead.

Thanks for the hint, best would be cycling acknowledges the behaviour of
match as bug and fixes it...
For my needs of comparisons though the symbol creation is most likely no
issue

Stefan

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

Roman Thilenius's icon

jan is in dialectic trouble anyway with this
idea since he had been taking java solutions
into account :)

i am big fan of the zl objects ... there should
be a few more of them ... like funnel and spray!

Stefan Tiedje's icon

Rob wrote:
> jasch, you're saying that if i use stefans tosymbol idea then my cpu
> will be running too hard. or at least there is an easier way to
> filter lists?

If you use it in the context you want to, its no problem, as there is
only a limited number of combination possibilties, each one would create
a symbol which will be stored somewhere in the memory, but its small. If
you want to compare ever changing values and keep doing so over months
this is an issue. No problem for your problem I guess...

Stefan

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

jasch's icon

and there's also L== by peter elsea,

how's that for dialectic....

>> Thanks for the hint, best would be cycling acknowledges the
>> behaviour of
>> match as bug and fixes it...
>> For my needs of comparisons though the symbol creation is most
>> likely no
>> issue
>>
>> Stefan
>
>
> jan is in dialectic trouble anyway with this
> idea since he had been taking java solutions
> into account :)
>
> i am big fan of the zl objects ... there should
> be a few more of them ... like funnel and spray!

or the whole python-suite in single max objects

Roman Thilenius's icon

Quote: jasch wrote on Sun, 16 April 2006 00:17
----------------------------------------------------
>
> and there's also L== by peter elsea,

there is also Y== by Yvonne Catterfeld but
that is OS 9 only.

no i dont think i like comparing lists as
a solution for routing them. you will have
to type a lot of lists when you have to
route data from 25x25 matrix, while the use
of [route] enables you to copy most parts
of the code.

-110 (in trouble as usual)