#0 to int within a subpatch


    Apr 30 2006 | 8:11 pm
    I need to collect the value associted with #0 in a subpatch and convert it
    to int. I am sure I've done this before and thought one of these worked...
    Cheers,
    Gary Lee Nelson
    TIMARA Department
    Oberlin College
    www.timara.oberlin.edu/GaryLeeNelson

    • Apr 30 2006 | 8:26 pm
      hi gary. i did not load your patch in max, but looking at the text patch
      it seems you have put a "." after #0 (why?).. i believe this is what's
      causing the problem.
      jm
    • Apr 30 2006 | 8:29 pm
      hi gary,
      maybe your memory converted the fromsymbol to a tosymbol ;-)
      jan klug
    • Apr 30 2006 | 8:35 pm
      Well duh...maybe I'm getting too old for this. :-)
      Thanks, Jan
      Cheers,
      Gary Lee Nelson
      TIMARA Department
      Oberlin College
      www.timara.oberlin.edu/GaryLeeNelson
    • Apr 30 2006 | 9:23 pm
      how dumb of me to not have open the patch.. but you didn't answer my
      question about why you put a dot after #0?? is there something i'm missing?
      jm
    • Apr 30 2006 | 9:36 pm
      > why you put a dot after #0??
      >
      that's what i also thought, but when i tried it out it appeared that
      max makes a $0 out of the #0 if there's nothing attached to it;
      gary's method seems to be a nice workaround for this!
      jan
    • Apr 30 2006 | 9:40 pm
      Actually the "." is what makes this possible. A "#0" all by itself turns
      into a "$0" I DON'T know the answer to this. A "#0." becomes perhaps
      "1001." which is a symbol. fromsymbol turns it into a float and int
      converts it to the integer I need. Someone taught me this trick a year ago
      and I remembered the "." but misremembered the fromsymbol as tosymbol.
      Cheers,
      Gary Lee Nelson
      TIMARA Department
      Oberlin College
      www.timara.oberlin.edu/GaryLeeNelson
    • Apr 30 2006 | 11:09 pm
      Actually someone else get credit for this. I posted a query to the list and
      this was the solution I received. Sorry I don't remember who that kind soul
      was.
      Cheers,
      Gary Lee Nelson
      TIMARA Department
      Oberlin College
      www.timara.oberlin.edu/GaryLeeNelson
    • Apr 30 2006 | 11:29 pm
      oh wow, very interesting! i usually use the "#0-whatever" method to give
      unique names to objects and then truncate to just the 1001 value if i
      need the value by itself. never knew about the dot thingee.. so much easier!
      this has got to be the best max tip i got in along time, thanks!
      jm