detecting data type

Cycling '74's icon

is it possible to detect what type of data is being passed by patch cords?

i want to write a sub-patch that will only let lists into its inlet, specifically lists that contain two integers.

how would you do that?

swieser1's icon

try a [zl len] object to check the length of the list. use the output to open and close a gate that either lets the list through (if it's 2 elements long) or blocks it.

Emmanuel Jourdan's icon

On 6 nov. 08, at 14:08, jimdrake wrote:

> is it possible to detect what type of data is being passed by patch
> cords?
>
> i want to write a sub-patch that will only let lists into its inlet,
> specifically lists that contain two integers.
>
> how would you do that?

[route int float list]?

ej

Cycling '74's icon

cool, thanks for that

how about checking for ints?

Cycling '74's icon

although, just tried it and because gate has its inputs the wrong way round it's not very neat

Cycling '74's icon

> [route int float list]?

fantastic, better.

i didn't know you could use route like that.

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

Tj Shredder's icon

jimdrake schrieb:
> although, just tried it and because gate has its inputs the wrong way
> round it's not very neat

There is also spigot from my Pd abhaXions...
(You can't imagine how simple it is... ;-)
((I have no idea why its called spigot))
(((and trigger is your friend anyway)))

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Guillaume Evrard's icon

hi,

i got a question about data type, why isn't {a 1} a list ?

here is a patch :

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

cheers

g

anya elioutina's icon

I planned to use digitech rp500's usb output as control feature, thinking it'l give me midi program and control messages, since it's working with it's x-edit Editor/Librarian software,but:
It shows in midi setup inputs/outputs and my midiin object is responding when i step on the pedals and tweek the knobs, but when i print, in Max output window I see a whole a lot of numbers, much more then a sandart midi messages. How can i identify and sort it to make it usefull?
Or maybe I suppose to use it with Hi object?
Anybody has any experience with it?
thanks
Anya

zoe's icon

I think a list is, in its strict definition, supposed to begin with an integer. Am I wrong? Also, I always wondered why the symbol recognition wasn't efficient with the route object. I guess you have to prepend the term "symbol" to the actual symbol for it being regarded as such.

Regards,
Z

Guillaume Evrard's icon

i didn't find any definition of what's a list in max. but maybe it has to start with a numerical value...

about the "prepend symbol", i want to be able to sort data regarding their types, so i need to be able to detect a symbol without prepending anything.

there's always the [atoi] solution... but it's a dirty one...

g

Guillaume Evrard's icon