Card shuffling emulator
Im an Audio Technology student new to Max MSP and having trouble with trying to create a patch which mimics the shuffling and dealing of a pack of cards.
I used the Urn object to mimic dealing out 52 cards without repetition and then used the select tool to print messages/display images when a certain number is dealt.
i.e 0 triggers Ace of Hearts message and image, 1 triggers 2 of Hearts message and image etc. etc.
Im also using the capture object to capture the numbers drawn to mimc the deck being put together again.
So now I need a way to shuffle the contents of the capture window and then deal out the sequence left after the shuffle.
Im quite new to all of this so might be a bit slow but if you can mention any keywords or topics for me to look at then that would help too. Any help at all would be appreciated.
I think that instead of "shuffling" the contents of capture you could re-use [urn] and achieve the same effect- or perhaps utilize [coll]- send the data from [capture] to coll and then work with it from there- it has much more functionality than [capture]. Also take a look at [urn-jb], which is the same as [urn], except that it maintains that there will never be repeats of numbers (which you may or may not want). Hope that helps!
You might want to try dealing with lists where you can use [zl scramble] to shuffle and [zl slice] to cut cards out of the deck. You can also use [% 13] and [/ 13] from the 0-51 card index to figure out the value and suit.
found this whilst looking for something unrelated
may be of use….
Mike S. – Thanks for the patch but its a little too helpful if you know what i mean.
thereishopeforus – THanks for pointing in me in the direction of lists as i think this might be the way forward.
email@example.com – Thanks for the input but dont really understand the coll function. Do you think this would be a good way forward? From the description It says that the data can be edited but it is going over my head a bit.
Im now using a list and the zl scramble object for the initial randomization of the pack. But im still stuck on mimicing a real human shuffle.
I know I need to select a random amount of cards say somewhere between 1 and 10 and I have to drop that group of cards back into the remainder of the pack at a random point. I feel if this was done say 10 times it would mimic a light overhand shuffle.
Can split the pack using zl slice and a a random number generator but do not know how to insert the split back into the other half of the deck (or other list). Tried using the zl join object but doesnt seem to be rejoining my list in the way I want it to.
I.e. it seems to assimilate the two lists together at random rather than dropping the smaller list into another.
Maybe I am misunderstanding the zl join object?
THanks for all the tips so far and if anyone reads this and has an idea then feel free to help.
The [zl slice] object joins one list to the end of the other. You’ll need to use a [zl slice] to split the original list and then [zl join] twice to piece the three lists back together. In the case below the list is inserted after the fourth item as per the "4" argument.
----------begin_max5_patcher---------- 492.3ocyV10SCBCEF9Z3Wwwd8bokOGdmWnIdgIFm2YLFFT2pAZWncwoF+uKs .6C+XLiCzKnjd3P666CsG5q1VnIhkTIBNAtErrd01xxDRGvptuEJOdYRVrzj FhSeRL4QzfpGonKUlvyKXbUSz4wpjYL9z6KnIppA2azP7.f3at45oacvCwvc 0uBeQNimQUlIgTG7AAWwiyolY3zBVbFZc5hEpl7w0QYolLK02wDOzFChj8hY PHNCw5nuYaqaF7677KYviBFucW6Fnu4GtaW67CcsyW3ZRSpU4oddNsRIHzfx qUS7+.nPLKB7HcOTv8GTxoRY7T5mnBAiKMIFbw3cPFRfqlFAQ51PyxExnCEY HelLQeOXNjPIQjmSWWcXETXbIsPQSgLlTAGCWc8YiGCWdFb9EWO9liZGTd0H xuyKmDh5dbHJXSY73LCNZc+Sk2CB6bq62KERkYrDJ30psGE0SkRc+6KZfAB3 .tfG3CAPHLBhZkOU0NH3tu3gyuq3gIGTFi+wieXrlN91DSJVTjzLCM+qCVau TpTUt6QwD7MSxaqjlwRSo7MWnmyRmW96JUsHf69xue6qlb1CI41qJxcefDt2 kDoMIQ1JotVRef.6PS8Glh12ub+.LQBcF5qO6k4TWgQq5rkVK67l86P8kELS -----------end_max5_patcher-----------
I apologise for my ignorance but dont know how to make sense of that text you pasted at the bottom of your reply.
Im assuming that the text represents a max patch but how can I look at it as a patch rather than plain text?
Forums > MaxMSP