Integration of Scheduling Tool

This commit is contained in:
computermusik 2024-12-02 15:11:41 +01:00
parent a3afe513da
commit 9926a64ec3
3 changed files with 2470 additions and 682 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@ var DJsterParams = {
"attenuation" : [0, 100, "linear"], // "attenuation" : [0, 100, "linear"], //
"chordal_weight" : [1, 5, "linear"],// "chordal_weight" : [1, 5, "linear"],//
"dynamics" : [0, 127, "linear"],// "dynamics" : [0, 127, "linear"],//
"event_length_display_style" : [0, 1, "linear"],//
"event_length" : [60, 600, "log"],// "event_length" : [60, 600, "log"],//
"eventfulness" : [0, 100, "linear"],// "eventfulness" : [0, 100, "linear"],//
"harmoniclarity" : [0, 100, "linear"],// "harmoniclarity" : [0, 100, "linear"],//
@ -72,6 +73,7 @@ function setSection(section)
outlet(1, "set_weights", "dictionary", networkData.name); outlet(1, "set_weights", "dictionary", networkData.name);
outlet(1, "predict", 0.5, 0.5); outlet(1, "predict", 0.5, 0.5);
outlet(0, 0.5, 0.5); outlet(0, 0.5, 0.5);
this.patcher.getnamed("mc.function").setvalueof(outdict.get(section + "::breakpoints"));
} }
currentPiece = section; currentPiece = section;
} }
@ -164,7 +166,7 @@ function train()
trainingData.push(j/5); trainingData.push(j/5);
break; break;
} }
post("param", param, trainingData, "\n"); //post("param", param, trainingData, "\n");
} }
//var val = data["hub::instrument::instrument-" + (p + 1)]; //var val = data["hub::instrument::instrument-" + (p + 1)];
trainingData.push(j/5); trainingData.push(j/5);
@ -191,43 +193,43 @@ function list()
for (var j = 0; j < vector.length/4; j++) { for (var j = 0; j < vector.length/4; j++) {
var k = j + i * vector.length/4; var k = j + i * vector.length/4;
switch (j) { switch (j) {
case 3 : //log case 1 : case 3 : case 10 : case 11 : case 15 : case 16 : case 20 : case 21 :
case 17 : 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]); var val = scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]);
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val); outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val);
break; break;
case 13 : //enum case 14 : //enum
//val = "Major"; //val = "Major";
//post(vector[k], Math.floor(vector[k]/0.2 + 1), "\n"); //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"]); outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::scale"]);
break; break;
case 16 : case 17 :
//val = "2 2 2"; //val = "2 2 2";
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::meter"]); outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::meter"]);
break; break;
case 18 : case 19 :
//val = "4" //val = "4"
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::timesig_denominator"]); outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::timesig_denominator"]);
break; break;
case 20 : case 21 :
//tonic pitch //tonic pitch
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::tonic_pitch"]); outlet(2, "Djster.µbus[" + i + "]::" + keys[j], jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["Djster.µbus[" + i + "]::tonic_pitch"]);
break; break;
case 21 : case 22 :
val = "4" val = "4"
outlet(2, "hub::instrument::instrument-" + (i + 1), jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["hub::instrument::instrument-" + (i + 1)]); outlet(2, "hub::instrument::instrument-" + (i + 1), jpieces[currentPiece][parseInt(vector[k]/0.2 + 1)]["hub::instrument::instrument-" + (i + 1)]);
break; break;
case 22 : case 23 :
src[0] = scale(vector[k], 0, 1, 0, 127); src[0] = scale(vector[k], 0, 1, 0, 127);
break; break;
case 23 : case 24 :
src[1] = scale(vector[k], 0, 1, 0, 127); src[1] = scale(vector[k], 0, 1, 0, 127);
outlet(2, "hub::src::src" + (i + 1), src); outlet(2, "hub::src::src" + (i + 1), src);
break; 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 default : //linear
var val = scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]); var val = scale(vector[k], 0, 1, DJsterParams[keys[j]][0], DJsterParams[keys[j]][1]);
outlet(2, "Djster.µbus[" + i + "]::" + keys[j], val); 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) function scale(x, inputmin, inputmax, outputmin, outputmax)
{ {