I’d like to have a list of numbers from 0-7 (the notes of the major scale, in this case) and have an automated way to create every combination of those numbers to store in a coll.

That means:

0, 1, 2, 3, 4, 5, 6, 7

0 1, 0 2… 2 3, 2 4, 5 7, 6 7, etc

0 1 2, 0 1 3, 0 1 4, etc

up to 0 1 2 3 4 5 6 7

I’ve been able to successfully do a small version of this with two counter objects that counts from 0-7, then 1-7, 2-7, and so on. Seems like a start but not exactly what I’m looking for.

Can do this by hand, but doing it automatically is more fun and interesting. Any thoughts appreciated!

]]>http://www.google.com/search?client=safari&rls=en&q=0o1234567+in+decimal&ie=UTF-8&oe=UTF-8

So, just get a counter to go from 0 to 342391, and then convert from decimal to octal (adding leading zeros if necessary). Here’s the first site I could find about the calculations required to convert from decimal to octal:

http://www.tpub.com/neets/book13/53j.htm

That’s one way to do it anyway. I’m sure there’s another combinatorial way to systematically find every combination.

]]>Will post the patch this weekend. What I have should be easily changed to convert any decimal number to octal, hexidecimal, etc – something that might be useful to others.

Thanks very much!

]]>lh

// lh.numeral.js

var inb = jsarguments[1] || 10;

var outb = jsarguments[2] || 2;

basein(inb);

baseout(outb);

function anything() {

outlet(0,parseInt(arrayfromargs(messagename,arguments)[0],inb).toString(outb));

}

function basein(x) {

inb = Math.min(Math.max(2,x),36);

}

function baseout(x) {

outb = Math.min(Math.max(2,x),36);

}

autowatch = 1;

// EOF

– Pasted Max Patch, click to expand. –

]]>
& 128

& 64

& 32

etc…

which when combined back into lists will give you binary representations of the numbers 0-255. These lists of 00100101 (etc.) can be used to grab numbers from your actual list. I’m not sure what the result will be exactly…will it give every combination? :) [zl mth] with a [sel] can grab the elements of the list, or there are other ways. You also might run the lists into a [matrixctrl] to see the spreads of the “ons” and “offs”, and you can always use presets for these too.

To sort the results, look to [zl group] and/or [zl len], and [zl sort], so you can separate the lists by length and get them in ascending order if they’re not already.

Doubtless there are hundreds of ways to go about this… it’s a good question nonetheless.

]]>