detect when in range


    Apr 16 2006 | 10:19 pm
    i need to see wether a number is within a certain range, is there a way of attaching an AND to the 'if' object?
    for example
    if $1 < 1 AND > 1 ...

    • Apr 16 2006 | 10:32 pm
      Have a look at the logic ops like || and &&. These are common
      programming operations. || means logical or and && means logical and.
      Most expression objects will support these operations as well.
      wes
    • Apr 16 2006 | 10:36 pm
      thanks for that.
    • Apr 16 2006 | 11:14 pm
      cool, i have worked out the syntax vaguely, how can i get a if object to output a bang?
    • Apr 16 2006 | 11:19 pm
      here is the patch
      max v2;
    • Apr 16 2006 | 11:23 pm
      sel 1 will output a bang if the input is 1
      trigger b will always output a bang
      depends on what you want.
      wes
    • Apr 16 2006 | 11:31 pm
      Here's the patch below. Some friendly advice which is probably too
      late for you now...read the manual and do the tutorials. Your patch
      showed some serious misunderstandings of max.
    • Apr 16 2006 | 11:31 pm
      could you look at the patcher,as it is not outputting anything at all
      cheers
    • Apr 16 2006 | 11:49 pm
      cant get that patcher to load, it just comes back up as text. isnt a patcher as text supposed to end with a 'pop' message?
      "read the manual and do the tutorials. Your patch
      showed some serious misunderstandings of max." ---i know. basically, i started with max about a year ago, then got quite heavily into flash.
      unfortunatly, my memory isnt as good as i had hoped, but i am on a tight deadline for my degree (music technology) and my project must be in max (well, or PD, but we wont go there!!)
      so i am relying on you peoples kind hearts and my own intensive 'on the job' research' to get through
      for the record, when you say serious misunderstandings, what do you mean?
      again, thank you very much for your patience. for the record i am very much enjoying my learning, and when i can i will return the goodwill by participating on this forum in a helping capacity
      cheers
    • Apr 16 2006 | 11:53 pm
      I sent you a version that does what you want. See my last email.
      wes
    • Apr 16 2006 | 11:59 pm
      Ok,
      you can just copy the text using command+C (apple + c on mac) and past
      using command+v into a patcher. All of the objects should appear and
      work.
      > for the record, when you say serious misunderstandings, what do you mean?
      >
      You were using the set message to do things that you can't use the set
      message to do. Also, the fact that bang is a message and can just be
      written as text for output from the if object.
      wes
    • Apr 17 2006 | 12:00 am
      emailed me direct? or PM the forum? i havent recieved any emails from you!
      psc.recordings@gmail.com
    • Apr 17 2006 | 12:13 am
      thanks for all you help!!
      got it now
      i'd like to say thats the last simple question i will have, but it wont be, so i wont!!
      again
      cheers
      John
    • Apr 17 2006 | 12:19 am
      Remember the one that you couldn't get to load?? Try that one using
      the instructions for copying and pasting. If you want to see it in
      the forum, go here:
      http://www.cycling74.com/forums/index.php?t=msg&th=19379&sta rt=0&rid=0&S=9dfa076a35fe24529ead0ab137c5878f
    • Apr 17 2006 | 12:26 am
      yeah, got it
      i never realised you could copy text direct into a patcher
      for the record, is there a way to extract text from a patcher also?
      my current method is to re-open the patcher as text and then copy and paste it
    • Apr 17 2006 | 12:36 am
      also
      in the help file for 'if' they use the syntax $i1, whereas in your solution you have used $f1, could you explain?
    • Apr 17 2006 | 12:39 am
      same way highlight your objects and command+c.
    • Apr 17 2006 | 12:51 am
      one is for floats one is for ints
    • Apr 17 2006 | 11:26 am
      I think the split object may be what you're looking for,
      Cheers
      Roger
    • Apr 17 2006 | 2:52 pm
      Quote: 88mph wrote on Sun, 16 April 2006 16:19
      ----------------------------------------------------
      > i need to see wether a number is within a certain range, is there a way of attaching an AND to the 'if' object?
      >
      > for example
      >
      > if $1 < 1 AND > 1 ...
      ----------------------------------------------------
      [if and if then else ... ] will not work, you
      would have to use two [if]s in series.
      what you want (topic) could be done by [split 22 33].
    • Apr 17 2006 | 3:06 pm
      [if ($f1 >= 1) && ($f1
      is equivalent to
      [split 1 2]
      /*j