Integration of Scheduling Tool
This commit is contained in:
parent
a3afe513da
commit
9926a64ec3
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@ var DJsterParams = {
|
||||
"attenuation" : [0, 100, "linear"], //
|
||||
"chordal_weight" : [1, 5, "linear"],//
|
||||
"dynamics" : [0, 127, "linear"],//
|
||||
"event_length_display_style" : [0, 1, "linear"],//
|
||||
"event_length" : [60, 600, "log"],//
|
||||
"eventfulness" : [0, 100, "linear"],//
|
||||
"harmoniclarity" : [0, 100, "linear"],//
|
||||
@ -72,6 +73,7 @@ function setSection(section)
|
||||
outlet(1, "set_weights", "dictionary", networkData.name);
|
||||
outlet(1, "predict", 0.5, 0.5);
|
||||
outlet(0, 0.5, 0.5);
|
||||
this.patcher.getnamed("mc.function").setvalueof(outdict.get(section + "::breakpoints"));
|
||||
}
|
||||
currentPiece = section;
|
||||
}
|
||||
@ -164,7 +166,7 @@ function train()
|
||||
trainingData.push(j/5);
|
||||
break;
|
||||
}
|
||||
post("param", param, trainingData, "\n");
|
||||
//post("param", param, trainingData, "\n");
|
||||
}
|
||||
//var val = data["hub::instrument::instrument-" + (p + 1)];
|
||||
trainingData.push(j/5);
|
||||
@ -191,43 +193,43 @@ function list()
|
||||
for (var j = 0; j < vector.length/4; j++) {
|
||||
var k = j + i * vector.length/4;
|
||||
switch (j) {
|
||||
case 3 : //log
|
||||
case 17 :
|
||||
case 1 : case 3 : case 10 : case 11 : case 15 : case 16 : case 20 : case 21 :
|
||||
var val = Math.round(scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]));
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val);
|
||||
break;
|
||||
case 4 : //log (not yet)
|
||||
case 18 :
|
||||
var val = scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]);
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val);
|
||||
break;
|
||||
case 13 : //enum
|
||||
case 14 : //enum
|
||||
//val = "Major";
|
||||
//post(vector[k], Math.floor(vector[k]/0.2 + 1), "\n");
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::scale"]);
|
||||
break;
|
||||
case 16 :
|
||||
case 17 :
|
||||
//val = "2 2 2";
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::meter"]);
|
||||
break;
|
||||
case 18 :
|
||||
case 19 :
|
||||
//val = "4"
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::timesig_denominator"]);
|
||||
break;
|
||||
case 20 :
|
||||
case 21 :
|
||||
//tonic pitch
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::tonic_pitch"]);
|
||||
break;
|
||||
case 21 :
|
||||
case 22 :
|
||||
val = "4"
|
||||
outlet(2, "hub::instrument::instrument-" + (i + 1), jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["hub::instrument::instrument-" + (i + 1)]);
|
||||
break;
|
||||
case 22 :
|
||||
case 23 :
|
||||
src[0] = scale(vector[k], 0, 1, 0, 127);
|
||||
break;
|
||||
case 23 :
|
||||
case 24 :
|
||||
src[1] = scale(vector[k], 0, 1, 0, 127);
|
||||
outlet(2, "hub::src::src" + (i + 1), src);
|
||||
break;
|
||||
case 1 : case 9 : case 10 : case 14 : case 15 : case 19 : case 20 :
|
||||
var val = Math.round(scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]));
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val);
|
||||
break;
|
||||
default : //linear
|
||||
var val = scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]);
|
||||
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val);
|
||||
@ -236,6 +238,14 @@ function list()
|
||||
}
|
||||
}
|
||||
|
||||
function setBreakPoints()
|
||||
{
|
||||
hsspiece[title]["breakpoints"] = this.patcher.getnamed("mc.function").getvalueof();
|
||||
outdict.parse(JSON.stringify(hsspiece));
|
||||
jpieces = JSON.parse(outdict.stringify());
|
||||
|
||||
}
|
||||
|
||||
|
||||
function scale(x, inputmin, inputmax, outputmin, outputmax)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user