generating bit lists based on positional values?

metamax's icon

I need to convert pitch class sets to bit lists and I am having trouble getting my head around the conversion of positional values to bits. Given a set of list positions how do I get 1's in each named position and 0's in all of the unnamed positions using standard Max objects?

Max Patch
Copy patch and select New From Clipboard in Max.

Wetterberg's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This seems to work:

metamax's icon

God damn that is beautiful.

metamax's icon

...Just found a zero bug in that solution. This should take care of it..

Max Patch
Copy patch and select New From Clipboard in Max.

Wetterberg's icon

ah yeah, didn't really take the time to check it through hehe. Whoops.