Serial Matricies and GitHub stuff

Just a quick .js for Max to generate a Serialist matrix based on a given tone-row. I’ve setup a little github (I’ve never done this before, so apologies if something isn’t quite there). The plan is to use this in conjunction with the Magic squares stuff mentioned in the last post.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Serialist Transposition Matrix
// owmtxy
// Create a Serialist transposition matrix based on initial tone row (input via message list)
// for Max/MSP [js] – add a message for tone row: pitches in numerical format 1-12
inlets = 2;
outlets = 2;
this.autowatch = 1; // auto-comile script when saved
var toneRow;
var serialMatrix = [];
var n;
function matrix(){
n = toneRow.length;
for(var i=0; i<n; i++){
for(var j=0; j<n; j++){
var x = toneRow[i] + toneRow[j];
serialMatrix.push(x%12); // wrap values at 12
}
}
}
function list(){
toneRow = arrayfromargs(arguments);
}
function bang(){
serialMatrix = [];
matrix();
outlet(0,serialMatrix);
}
// output into a jit.fill >> jit.matrix >> jit.cellblock or something.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>