Forums > MaxMSP

All combinations of 4 variables with values 1-3

Mar 31 2015 | 6:28 am

i have txt files in a folder with names
1b1, 1b2, 1b3
2b1, 2b2, 2b3
3b1, 3b2, 3b3
4b1, 4b2, b43

Im trying to develope a patch that compares the differences between two txt files (with dna code for example).
I compare 4 txt files each time (1bx 2by 3bz 4bw) so want all the possible combinations of x y z w
1bx 2by 3bz 4bw
1<= x <=3
1<= y <=3
1<= z <=3
1<= w <=3

actually the first 2 characters of the txt’s name are always the same because they mean
1b1 = Baby’s 1 dna sample of father’s 1 dna
1b2 = Baby’s 1 dna sample of father’s 2 dna
1b3 = Baby’s 1 dna sample of father’s 3 dna
2b1 = Baby’s 2 dna sample of father’s 1 dna…etc

i have a patch that only allows me to get 3 combinations
1b1 2b1 3b1 4b1
1b2 2b2 3b2 4b2
and 1b3 2b3 3b3 4b3

I want to apply this combinations in umenu if possible.

Thank you!

Mar 31 2015 | 7:19 am

I think that’s just a matter of writing it out, isn’t it? IIRC there’d be 24 combinations?

Mar 31 2015 | 10:07 am

ok i’ll give it a try!

I think it is 3^4=81.
It is like 2^3=8 in binary

anw am not sure =)

Thank you very much!!!

Mar 31 2015 | 2:23 pm

I have never created my object. I am new.
How can i create my object.
Is that supposed to be in C, Java??
Can you give me some informations please??

Thank you!

Mar 31 2015 | 4:24 pm

I’d do it in java because it has built-in string comparison methods; also much easier to make an external in java imho– have a look at the mxj help files and look for the document "WritingMaxExternalsInJava". You can also use javascript (js object), but I can’t give advice on js — I assume javascript has sophisticated string operation methods too… but you’re on the right track– there is no way I’d try and do what your doing without making an external for it

Apr 01 2015 | 3:44 am

ok very nice!
Thank you very much!

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP