1

I work on a project with MaxMSP where I have multiple colls. I want to combine all the lists in there in one single coll. Is there a way to do that directly without unpacking and repacking everything?

In order to be more clear, let’s say I have two colls, with the first one being:

0, 2 1, 4 2, 4 …. 99, 9

while the second one is:

100, 8 101, 4 … 199, 7

I would like the final coll to be one list from 0-199.

Please keep in mind I don’t want to unpack everything ( with uzi for instance) cause my lists are very long and I find that it is problematic for the cpu to use colls with such long lists.That’s why I broke my huge list into sublists/subcolls in the first place

Hope that’s clear enough.

tim.a
  • 83
  • 1
  • 1
  • 10

2 Answers2

1

If the two colls do not have overlapping indices, then you can just dump one into the other, like this:

----------begin_max5_patcher----------
524.3ocyU0tSiCCD72IOEQV7ybnZmFJ28pfPUNI6AlKwIxeTZEh28ydsCDNB
hzdGbTolTOd20yXOd6CoIjp98flj8irqxRRdHMIAg7.IwwIjN995VtFCizAZ
M+FfjGly.6MHdisaXDTZ6DxVvfYvhfCbS8sB4MaUPsIrhWxNeUdFsf5esFex
bPYW+bc5slwBQinhFbA6qt6aaFWwPXlCCPnxDxSEQaNzhnDhG3wzT+i7+R4p
AS1YziUvTV44W3+r1ozxUnrKNdYW9gKaIbuagdkpGTv.HalU1z26bl8cTpkk
GufK9eI35911LMT2ephtnbs+0l2ybu90hl81hNex241.hHd1usga3QgGUteB
qDoYQdDYLpqv3dJR2L+BNLQodjc7VajJzrqivgs5YSkMaprkjZwroVLI03Oc
0HtKv2AMac6etChsbiQIprlPKto6.PWEfa0zX5+i8L+TnzlS7dBEaLPC8GNN
OC8qkm4MLMKx0Pm21PWjugNuwg9A6bv8URqP9m+mJdX6weocR2aU0imPwyO+
cpHiZ.sQH4FQubRLtt+YOaItUzz.3zqFyRn4UsANtZVa8RYyKWo4YSwmFane
oXSwBXC6SiMaV.anmHaBlZ9vvNPoikDIhqa3c8J+vM43PgLLDqHQA6Diwisp
Hbkqimwc8xpBMc1e4EjPp8MfRZEw6UtU9wzeCz5RFED
-----------end_max5_patcher-----------     
mmking
  • 1,564
  • 4
  • 26
  • 36
mzed
  • 61
  • 2
0

mzed's answer works, as stated if the lists have no overlapping indices which they shouldn't based on the design you specify.

If you are treating your 'huge list' as multiple lists, or vice versa, that might help come up with an answer. One question some may ask is "why are you merging it again?"

  • you consider your program to have one large list
  • that large list is really an interface that handles how you interact with several sub-lists for efficiency sake
  • the interface to your data persistence (the lists) for storing and retrieval then acts like one large list but works with several under-the-hood
  • an insertion and retrieval mechanism for handling the multiple lists as one list should exist for your interface then
  • save and reload the sublists individually as well

If you wrap this into a poly~, the voice acts as the sublist, so when I say voice I basically mean sublist: You could use a universal send/receive in and out of a poly~ abstraction that contains your sublist's unique coll, the voice# from poly~ can append uniquely to your sublist filename that is reading/saving to for that voice's [coll].
With that set up, you could specify the number of sublists (voices) and master list length you want in the poly~ arguments like:

[poly~ sublist_manager.maxpat 10 1000] // 10 sublists emulating a 1000-length list

The math for index lookup is:

//main variables for master list creation/usage
master_list_length = 1000
sublist_count = 10
sublist_length = master_list_length/sublist_count;

//variables created when inserting/looking up an index
sublist_number = (desired_index/sublist_count); //integer divide to get the base sublist you'll be performing the lookup in 
sublist_index = (desired_index%sublist_length); //actual index within your sublist to access

If the above ^ is closer to what you're looking for I can work on a patch for that. cheers

Jordan Stefanelli
  • 1,446
  • 1
  • 13
  • 13