random and change - help please


    Nov 30 2006 | 10:45 am
    Hi,
    Tis is probably a total newbie question but i really need your help as i have tried all the ways i can think of.
    Here is my problem:
    I need to generate a random number betveen 0 and 3 on each bang to random and filter the numbers so that there are no immediate repetitions ever (so just using [deal] does not work). I'm trying to do that by connecting [random] and [change]. Change filters out the repetitions nicely but i need a way to send bang to random when [change] has filtered out the int random sent so the [random] would trie automatically again until a different int is generated and change lets it pass.
    Here is what i have now:
    thanks
    Taaniel

    • Nov 30 2006 | 11:03 am
      On 30 nov. 06, at 11:45, Taaniel wrote:
      > Hi,
      > Tis is probably a total newbie question but i really need your help
      > as i have tried all the ways i can think of.
      >
      > Here is my problem:
      > I need to generate a random number betveen 0 and 3 on each bang to
      > random and filter the numbers so that there are no immediate
      > repetitions ever (so just using [deal] does not work). I'm trying
      > to do that by connecting [random] and [change]. Change filters out
      > the repetitions nicely but i need a way to send bang to random when
      > [change] has filtered out the int random sent so the [random] would
      > trie automatically again until a different int is generated and
      > change lets it pass.
      Hi,
      There's an abstraction called "urn-jb" in the examples folder of Max.
      It uses the urn object which output random numbers without
      duplicates, and some "intelligence" to filter the possible repetition
      at the start of a new serie.
      HTH,
      ej
    • Nov 30 2006 | 11:20 am
      Like this ?
      cheers
      Roger
      --- Taaniel wrote:
      >
      >
      > Here is my problem:
      > I need to generate a random number betveen 0 and 3
      > on each bang to random and filter the numbers so
      > that there are no immediate repetitions ever (so
      > just using [deal] does not work). I'm trying to do
      > that by connecting [random] and [change]. Change
      > filters out the repetitions nicely but i need a way
      > to send bang to random when [change] has filtered
      > out the int random sent so the [random] would trie
      > automatically again until a different int is
      > generated and change lets it pass.
      >
    • Nov 30 2006 | 1:11 pm
      an annotated solution without urn
      Roby
      On 30 nov. 06, at 11:45, Taaniel wrote:
      > Here is my problem:
      > I need to generate a random number betveen 0 and 3 on each bang to
      > random and filter the numbers so that there are no immediate
      > repetitions ever (so just using [deal] does not work). I'm trying
      > to do that by connecting [random] and [change]. Change filters out
      > the repetitions nicely but i need a way to send bang to random when
      > [change] has filtered out the int random sent so the [random] would
      > trie automatically again until a different int is generated and
      > change lets it pass.
      >
      > Here is what i have now:
      >
      >
    • Nov 30 2006 | 1:38 pm
      so much for your help !
      Taaniel
    • Nov 30 2006 | 6:34 pm
      On Nov 30, 2006, at 5:11 AM, Roby Steinmetzer wrote:
      >> I need to generate a random number betveen 0 and 3 on each bang to
      >> random and filter the numbers so that there are no immediate
      >> repetitions ever (so just using [deal] does not work).
      I think this works...if someone finds a bug please let me know...
      max v2;
    • Nov 30 2006 | 9:14 pm
      You can also check out "anti-bis" from RTC-lib by Karlheinz Essl.
      Best,
      Trond
      >>> /I need to generate a random number betveen 0 and 3 on each bang to
      >>> random and filter the numbers so that there are no immediate
      >>> repetitions ever (so just using [deal] does not work). /
      >>>
    • Dec 01 2006 | 7:31 am
      a simple arithmetic solution (uncommented)
      //yac
    • Dec 01 2006 | 8:30 am
      try this
      Lorenzo
      max v2;
    • Dec 01 2006 | 2:25 pm
      Taaniel wrote:
      > Here is my problem: I need to generate a random number betveen 0 and
      > 3 on each bang to random and filter the numbers so that there are no
      > immediate repetitions ever (so just using [deal] does not work).
      Yet another one:
      --
      Stefan Tiedje------------x-------
      --_____-----------|--------------
      --(_|_ ----|-----|-----()-------
      -- _|_)----|-----()--------------
      ----------()--------www.ccmix.com
    • Dec 04 2006 | 5:51 pm
      Yacine Sebti wrote:
      > a simple arithmetic solution (uncommented)
      nice one...
      took a while to understand why it works...
      it's probably faster than any comparison for duplicates...
      You win the price for the most elegant solution. Could be a wonderful
      task for Max classes... It shows that there are a lot of very different
      kind of obvious solutions, but there might be still an even more elegant
      solution out there...
      Stefan
      --
      Stefan Tiedje------------x-------
      --_____-----------|--------------
      --(_|_ ----|-----|-----()-------
      -- _|_)----|-----()--------------
      ----------()--------www.ccmix.com