detecting data type


    Nov 06 2008 | 1:08 pm
    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?

    • Nov 06 2008 | 1:33 pm
      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.
    • Nov 06 2008 | 1:40 pm
      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
    • Nov 06 2008 | 1:44 pm
      cool, thanks for that
      how about checking for ints?
    • Nov 06 2008 | 1:48 pm
      although, just tried it and because gate has its inputs the wrong way round it's not very neat
    • Nov 06 2008 | 1:56 pm
      > [route int float list]?
      fantastic, better.
      i didn't know you could use route like that.
    • Nov 07 2008 | 2:39 pm
    • Nov 07 2008 | 5:53 pm
      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
    • Dec 11 2008 | 2:16 pm
      hi,
      i got a question about data type, why isn't {a 1} a list ?
      here is a patch :
      cheers
      g
    • Dec 11 2008 | 3:44 pm
      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
    • Dec 11 2008 | 3:50 pm
      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
    • Dec 11 2008 | 3:56 pm
      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
    • Dec 11 2008 | 10:32 pm