Recent changes
New functionality: Playing hours Settings file and defaults
This commit is contained in:
parent
a52456fbd9
commit
c976a536f3
9
HSS_Settings.json
Normal file
9
HSS_Settings.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"operating_hours" : "9-18",
|
||||
"playing_mode" : "Playlist",
|
||||
"play" : 1,
|
||||
"duration" : 300,
|
||||
"silence" : 20,
|
||||
"gain" : -10,
|
||||
"current_piece" : "The soft sparks of the blue mind"
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
"1" : {
|
||||
"id" : 1,
|
||||
"data" : {
|
||||
"hub::instrument::bank" : [ "HSS_Samples_25.7.24.json" ],
|
||||
"hub::instrument::bank" : [ "HSS_Samples.json" ],
|
||||
"hub::instrument::instrument-1" : [ "Gentle-Metallic-4.instr.json" ],
|
||||
"hub::instrument::instrument-2" : [ "Large-Space.instr.json" ],
|
||||
"hub::instrument::instrument-3" : [ "Evolution.instr.json" ],
|
||||
@ -16680,7 +16680,7 @@
|
||||
"2" : {
|
||||
"id" : 2,
|
||||
"data" : {
|
||||
"hub::instrument::bank" : [ "HSS_Samples_25.7.24.json" ],
|
||||
"hub::instrument::bank" : [ "HSS_Samples.json" ],
|
||||
"hub::instrument::instrument-1" : [ "Gentle-Metallic-4.instr.json" ],
|
||||
"hub::instrument::instrument-2" : [ "Large-Space.instr.json" ],
|
||||
"hub::instrument::instrument-3" : [ "Evolution.instr.json" ],
|
||||
@ -33355,7 +33355,7 @@
|
||||
"3" : {
|
||||
"id" : 3,
|
||||
"data" : {
|
||||
"hub::instrument::bank" : [ "HSS_Samples_25.7.24.json" ],
|
||||
"hub::instrument::bank" : [ "HSS_Samples.json" ],
|
||||
"hub::instrument::instrument-1" : [ "Gentle-Metallic-4.instr.json" ],
|
||||
"hub::instrument::instrument-2" : [ "X_Windwhistle.instr.json" ],
|
||||
"hub::instrument::instrument-3" : [ "Evolution.instr.json" ],
|
||||
@ -50030,7 +50030,7 @@
|
||||
"4" : {
|
||||
"id" : 4,
|
||||
"data" : {
|
||||
"hub::instrument::bank" : [ "HSS_Samples_25.7.24.json" ],
|
||||
"hub::instrument::bank" : [ "HSS_Samples.json" ],
|
||||
"hub::instrument::instrument-1" : [ "Gentle-Metallic-4.instr.json" ],
|
||||
"hub::instrument::instrument-2" : [ "X_Windwhistle.instr.json" ],
|
||||
"hub::instrument::instrument-3" : [ "Evolution.instr.json" ],
|
||||
@ -66705,7 +66705,7 @@
|
||||
"5" : {
|
||||
"id" : 5,
|
||||
"data" : {
|
||||
"hub::instrument::bank" : [ "HSS_Samples_25.7.24.json" ],
|
||||
"hub::instrument::bank" : [ "HSS_Samples.json" ],
|
||||
"hub::instrument::instrument-1" : [ "Gentle-Metallic-4.instr.json" ],
|
||||
"hub::instrument::instrument-2" : [ "X_Windwhistle.instr.json" ],
|
||||
"hub::instrument::instrument-3" : [ "Evolution.instr.json" ],
|
||||
|
@ -90,7 +90,7 @@ css.push({
|
||||
"border" : "1px solid " + active,
|
||||
"color" : active,
|
||||
"padding" : "5px 5px",
|
||||
"text-align" : "center",
|
||||
"text-align" : "left",
|
||||
"display" : "inline-block",
|
||||
"font-size" : "12px",
|
||||
"margin" : "4px 2px"
|
||||
@ -202,12 +202,12 @@ svg.push({
|
||||
|
||||
addMenu(-1, "basicDIV", "Piece", "piece", 36, 0, pieces, "wide");
|
||||
addMenu(-1, "basicDIV", "Playing Mode", "mode", 76, 0, modes, "wide");
|
||||
addCheckbox(-1, "basicDIV", "Play", "play", 116, 0, "left");
|
||||
addSlider(-1, "basicDIV", "Tempo", "tempo", 1, [1, 200], 0.1, 60, "this.value", "this.value");
|
||||
addSlider(-1, "basicDIV", "Duration", "duration", 2, [60, 600], 1, 300, "this.value", "this.value");
|
||||
addSlider(-1, "basicDIV", "Silence", "silence", 3, [10, 60], 1, 10, "this.value", "this.value");
|
||||
addSlider(-1, "basicDIV", "Gain (dB)", "gain", 4, [-70, 6], 1, -10, "this.value", "this.value");
|
||||
|
||||
addText(-1, "basicDIV", "Playing Hours", "oph", 116, "wide");
|
||||
addCheckbox(-1, "basicDIV", "Play", "play", 152, 0, "left");
|
||||
addSlider(-1, "basicDIV", "Tempo", "tempo", 2, [1, 200], 0.1, 60, "this.value", "this.value");
|
||||
addSlider(-1, "basicDIV", "Duration", "duration", 3, [60, 600], 5, 300, "this.value", "this.value");
|
||||
addSlider(-1, "basicDIV", "Silence", "silence", 4, [10, 60], 1, 10, "this.value", "this.value");
|
||||
addSlider(-1, "basicDIV", "Volume (dB)", "gain", 5, [-70, 6], 1, -10, "this.value", "this.value");
|
||||
|
||||
for (var i = 0; i < 4; i++) {
|
||||
var j = 0;
|
||||
@ -510,7 +510,7 @@ function addMenu(index, parent, name, id, position, value, array, type)
|
||||
function addCheckbox(index, parent, name, id, position, checked, type)
|
||||
{
|
||||
var left = (type == "left") ? 10 : 252;
|
||||
var leftoffset = (type == "left") ? 126 : 85;
|
||||
var leftoffset = (type == "left") ? 128 : 85;
|
||||
checkboxes[index + 1][id].name = name;
|
||||
checkboxes[index + 1][id].pos = [left + leftoffset - 4, position - 1];
|
||||
checkboxes[index + 1][id].parent = parent;
|
||||
@ -548,11 +548,56 @@ function addCheckbox(index, parent, name, id, position, checked, type)
|
||||
},
|
||||
"oninput" : "drawsocket.send({" + "djster" + ": {player: " + (index + 1) + ", " + id + ": this.checked}})"
|
||||
}];
|
||||
|
||||
elements.push(obj[0]);
|
||||
elements.push(obj[1]);
|
||||
}
|
||||
|
||||
function addText(index, parent, name, id, position, type)
|
||||
{
|
||||
var width = (type == "wide") ? 180 : 90;
|
||||
var obj = [{
|
||||
"parent" : parent,
|
||||
"new" : "label",
|
||||
"for" : id + "_" + index,
|
||||
"id" : id + "-label" + "_" + index,
|
||||
"text" : name + ":",
|
||||
"style" : {
|
||||
"position" : "absolute",
|
||||
"top" : position + "px",
|
||||
"left" : "10px",
|
||||
"width" : "120px",
|
||||
"font-family" : "Arial",
|
||||
"font-size" : 10,
|
||||
"color" : textcolor
|
||||
}
|
||||
},
|
||||
{
|
||||
"parent" : parent,
|
||||
"new" : "input",
|
||||
"type" : "text",
|
||||
"id" : id + "_" + index,
|
||||
"name" : id + "_" + index,
|
||||
"placeholder" : "0-12 12-24",
|
||||
"size" : 10,
|
||||
"onkeydown" : "if( event.key == 'Enter' ){drawsocket.send( {" + "djster" + ": {player: " + (index + 1) + ", " + id + ": this.value}} );}",
|
||||
"style" : {
|
||||
"position" : "absolute",
|
||||
"top" : position - 1 + "px",
|
||||
"left" : "139px",
|
||||
"width" : width - 11 + "px",
|
||||
"color" : textcolor
|
||||
}
|
||||
}];
|
||||
var obj2 = {
|
||||
"id" : id + "_value" + "_" + index,
|
||||
"args" : "v",
|
||||
"body" : "document.getElementById('" + id + "_" + index + "').value = v"
|
||||
};
|
||||
elements.push(obj[0]);
|
||||
elements.push(obj[1]);
|
||||
body.push(obj2);
|
||||
}
|
||||
|
||||
function createSpatBox()
|
||||
{
|
||||
svg.push({
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,8 @@ var filename = "";
|
||||
var currentPiece = "";
|
||||
var hsspiece = {};
|
||||
var metaComposition = "";
|
||||
var outdict = new Dict("HSSPieces");;
|
||||
var outdict = new Dict("HSSPieces");
|
||||
var settings = new Dict("HSS_settings");
|
||||
var points = [[0.5, 0.5], [0., 1.], [1., 1.], [1., 0.], [0., 0.]];
|
||||
var net = new Dict;
|
||||
var DJsterParams = {
|
||||
@ -48,7 +49,10 @@ function loadbang()
|
||||
|
||||
function bang()
|
||||
{
|
||||
if (metaComposition != "") readPiece(path + metaComposition);
|
||||
if (metaComposition != "") {
|
||||
readPiece(path + metaComposition);
|
||||
readSettings(path + "HSS_settings.json");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +73,36 @@ function readPiece(path)
|
||||
setMenu();
|
||||
}
|
||||
|
||||
function readSettings(path)
|
||||
{
|
||||
settings.import_json(path);
|
||||
var _settings = JSON.parse(settings.stringify());
|
||||
var param = new Dict;
|
||||
var paramName = "";
|
||||
for (key in _settings) {
|
||||
param.set("player 0");
|
||||
if (key == "playing_mode") paramName = "mode";
|
||||
else if (key == "operating_hours") paramName = "oph";
|
||||
else paramName = key;
|
||||
param.set(paramName, _settings[key]);
|
||||
this.patcher.getnamed("webcontrol").message("param", "dictionary", param.name);
|
||||
switch (key) {
|
||||
case "playing_mode" :
|
||||
this.patcher.getnamed("oph").subpatcher().getnamed("mode").message((_settings[key] == "Playlist") ? 1 : 0);
|
||||
break;
|
||||
case "duration" :
|
||||
this.patcher.getnamed("duration").message(_settings[key]);
|
||||
break;
|
||||
case "silence" :
|
||||
this.patcher.getnamed("pause").message(_settings[key]);
|
||||
break;
|
||||
case "gain" :
|
||||
this.patcher.getnamed("hub").subpatcher().getnamed("global").subpatcher().getnamed("gain").message(_settings[key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setPresetFile(f)
|
||||
{
|
||||
filename = f;
|
||||
|
Loading…
Reference in New Issue
Block a user