Random Max question involving 1's and 0's

Jun 17, 2011 at 2:12pm

Random Max question involving 1's and 0's

Hi Guys,

Just wondering if anyone knows of an object that can create a preference for one value over another if both values are received at the same time.

For example:

A constant stream of 0′s are being banged by a metro and these are stored in a zl group. However, every now and then a 1 will be banged at the same time as a 0. I need the zl group to ignore the 0 if this happens and store the 1 instead. The stream of 0′s needs to stay constant.

Does anyone know of an object that can do this?

Thanks for any help

#57653
Jun 17, 2011 at 2:32pm

You should bear in mind that nothing in Max happens ‘at the same time’. There is order to all events. In the below patcher, on each metro bang, the contents of int is sent, and then it is set to 0. By sending a 1 to int, we can replace the 0 that will next be sent.

– Pasted Max Patch, click to expand. –
#206584
Jun 17, 2011 at 3:00pm

That little patch is perfect, thank you very much.

Also thanks for the advice, i won’t forget it.

James

#206585
Jun 17, 2011 at 3:46pm

as long as there are 0s and 1s involved into your computing issues, everything is okay.

when you ever see a 2 in your computer, there is something really really wrong.

-110

#206586

You must be logged in to reply to this topic.