Round Robin

Blake7's icon

Sorry this is prob a very easy question..

I need something that will produce a round robin type effect in a message box. So that every time a bang is send it sends the next number in the sequenence..

cheers for any help given

Blake

(karrrlo)'s icon

maybe [coll] would be your friend .
store your numbers or messages in a coll object, retrieve these messages with a counter using the "inc" message

Quote: Blake7 wrote on Wed, 05 March 2008 22:00
----------------------------------------------------
> Sorry this is prob a very easy question..
>
> I need something that will produce a round robin type effect in a message box. So that every time a bang is send it sends the next number in the sequenence..
>
> cheers for any help given
>
> Blake
----------------------------------------------------

Blake7's icon

cheers for you help..

I think this is prob what i want to use.. cant seem to work it out tho.. the counter object is doing exactly what i want but i want it to cyle through chosen numbers rather than incrments of one..

johnpitcairn's icon

zl is your friend...

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

davidestevens's icon

On 5 Mar 2008, at 21:47, Joe Blaker wrote:
> the counter object is doing exactly what i want but i want it to
> cyle through chosen numbers rather than incrments of one..

So if I understand what you're wanting to do ... the counter is
spitting out sequential numbers, and you need to map those numbers to
the numbers you actually want. You could use [table] or [coll].

eg
index value
1 10
2 13
3 19
4 26

etc. So when you send the output of counter to the coll or table
(1,2,3,4), you get the numbers you want (10,13,19,26) from the output
of coll or table.

Does that make sense?

David

>

Blake7's icon

Yes Yes it is!!

and so are you!

cheers..... been tryin to work this out for ages

johnpitcairn's icon

Uh ... simpler:

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

(karrrlo)'s icon

Quote: Blake7 wrote on Wed, 05 March 2008 22:56
----------------------------------------------------
> Yes Yes it is!!
>
> and so are you!
>
> cheers..... been tryin to work this out for ages
----------------------------------------------------

some people are way faster then me for replying , here were two options explaining what i ment earlier , which have been clearly explained by the other posters :)

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

Blake7's icon

sorry to bother u again..is there anyway to have a bang comein from another location to make the numbers go the oposite direction?

Stefan Tiedje's icon

John Pitcairn schrieb:
> zl is your friend...

I agrree, but I would use zl queue and then bang the zl, no counter
needed. You might want to reload the list if you reach zero...

Stefan

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

johnpitcairn's icon

Quote: Stefan Tiedje wrote on Thu, 06 March 2008 12:34
----------------------------------------------------
> I agrree, but I would use zl queue and then bang the zl

Heh. I tend to forget about the stuff in the "more..." help patcher. Anyway, since it seems I'm posting patches today:

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

Stefan Tiedje's icon

John Pitcairn schrieb:
> Quote: Stefan Tiedje wrote on Thu, 06 March 2008 12:34
> ----------------------------------------------------
>> I agrree, but I would use zl queue and then bang the zl
>
> Heh. I tend to forget about the stuff in the "more..." help patcher.
> Anyway, since it seems I'm posting patches today:

Uhh this will fill up your queue with each bang by the length of your
list-1. But fortunately there is a limit of 256 entries I hope... ;-)

use a sel 0 to the right outlet to bang in the list again when the queue
is empty. To reverse the order use [zl stack]....

Stefan

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

Blake7's icon

still cant get this to work :( dispite rediculous amounts of help

I dont see you i can use the ZL stack to reverse it?

johnpitcairn's icon

Quote: Stefan Tiedje wrote on Thu, 06 March 2008 21:13
----------------------------------------------------
> use a sel 0 to the right outlet to bang in the list again when
> the queue is empty. To reverse the order use [zl stack]....

Ooops. Guess I made it a little TOO simple (ie broken), duh ;)

But banging the list in again assumes the list remains static for (length) bangs - I was thinking it's possible the content and/or length of the list could change between bangs (Blake7 doesn't say). In which case, my first solution with zl nth and counter should work, assuming you wanted the next item regardless of whether the list content or length has changed.

Blake7, is the following not suitable? If not, why not?

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