deleting some values from a zl queue?
Hi, my name is Julieta,
I haven’t used Max for too long, and I am trying to work on the logic of my program. I am a little stuck on this, and I am wondering if someone would have any suggestions…. I have five spots on the floor (numbered 0 to 4) that are read as with a status ON of Off according to the presence of a person on that spot.
I need to keep track of the spots that are ON, and also the order in which they were activated. So I want to use a zl queue to store the spots that are turning ON, and then pop them in the same order after certain events. But if a spot is turned to OFF, I want to be able to remove it from the queue. Is this possible with a zl queue?
For example, if the spots 1, 4, 0 and 3 are turned ON, I store them in this order, the queue would pop 1, then 4, but if at that point I receive a signal that spot 0 is now OFF, I need to be able to remove the 0 from the queue so that the next one popped would be 3. etc.
I was using FUNBUFF before, which worked fantastic to track which ones were on or off, but I wasn’t able to keep track of the order.
Thanks in advance for any advice on this!
hello – i would probably do this using lobjects http://arts.ucsc.edu/ems/Music/research/Lobjects.readme.html
it has objects for this and a bunch of other useful list operations. the attached patch does what you describe using lbuild, but there are many other ways..
----------begin_max5_patcher---------- 1329.3oc6b00jhhCE8Y8WAE09naWg.B59vT076nqo5BkzNYGDnfXu8tSM+2W HATBPz.zpXO2WDM7QN2St4lbOFxOmOybS76jLSi+x3YiYy947Yy3EUTvrxeO ybu+6aC8y3Wl4dRVl+Nh4Bw4Xj2Y7x2FR7SqJM5vdZTHgwuEbYgI9rsemFs6 kTxVlnJ8dBsvvxwo3fM9ok4+X4SHiuc5wDefU8brJKkFvqv3M+8e5XUUiuFG wh72S3m5qoT+vpyHdBr+MgHpSSyiO+jTRFIh4ynwQ0PksKGPVdqJNfJ+33cU TUYz+i+3V+DpnveMedwGKzjCiH+SN5aQgIF1cRfVpIPKGNE5hpwfdJYPbaFz d8PXvE0YwF7QcvRRKYgRZH+hogj2HoY4LdMSal4ISZI2VVyaBbc3+vYUM9Om b2EFu8GDtQfpJLf7ZedFwIjnSWOpdCsTqs3JoQ0cUZVu9GBYuzIKHe5W82RT ducR8yL2kRChiJvfzcVTbUs8LuSibWmxqHxOoialEGGtwO8MZFcSHQpYH2u0 Oht2m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0XE9kHKbhfjZlfSIU0JwlhM9vSIrnHoF4qoUBMcmLSq1Mcgjsj1MmARV2L HUrzwmZPBOMYookuzJMPTCXeSZ3lVrzZcXI7sOHvzhkrPZ.oF39p6L4L4hB3 oiyjysmklXNSSuXkZMS.7H7kx+wul++P3jZLZ -----------end_max5_patcher-----------
Thank you for your reply… but how do I read what you just sent?
(I am using Max 4.6)
[coll] makes this easier.
yes this patch is max5 im afraid – i might be able to put it into max 4.6 tomorrow
in the meantime, perhaps roman could post his coll solution..?(you’re right btw, the wood was in front of the trees)
Forums > MaxMSP