[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] Twelve-Tone Matrix



Hello,

I am trying to create an algorithm to generate 12-tone matrices, like the one here: 

http://www.instructables.com/id/Create-a-Twelve-Tone-melody-with-a-Twelve-Tone-Mat/


I'm getting stuck, though - processing arrays is still very mysterious to me. I'm not sure what the correct way to do this all is.   So far, I think I have the first process in place.. but I'm not sure how to get to the next process. 


//starting row;
~row1=[3, 1, 9, 5, 4, 6, 8, 7, 12, 10, 11, 2];

~column1=
{
arg row, new=Array.new(12);
for (0, row.size-1, { 
arg i=1; 
var next = row[i-1];
if (prev == nil) {prev=0}    //case against nil
{|x, b|
x=(row[i]-next);    //subtract the next row item from the current row item
if (x < 0) {b=x.abs} {b=0-x};    //if negative, go positive. if positive, go negative.
new.add(b);          //add to array.
};
});
new.postln;
};

~column1.(~row1);


Thank you,
J