From 494d5701735513e704ef57294bba9574486e0bf9 Mon Sep 17 00:00:00 2001 From: mwinter Date: Wed, 30 Aug 2023 12:39:04 +0200 Subject: [PATCH] adding output control and mucho bug fixes --- .../custom_module_hdp_sync.js | 6 +- live_utilities/openstagecontrol/mixer.json | 104 +++++++++++++++++- .../openstagecontrol/mixer_transport.json | 4 +- .../supercollider/live_utilities.scd | 39 +++---- 4 files changed, 120 insertions(+), 33 deletions(-) diff --git a/live_utilities/openstagecontrol/custom_module_hdp_sync.js b/live_utilities/openstagecontrol/custom_module_hdp_sync.js index 47c2f18..9dbf06f 100644 --- a/live_utilities/openstagecontrol/custom_module_hdp_sync.js +++ b/live_utilities/openstagecontrol/custom_module_hdp_sync.js @@ -142,11 +142,11 @@ module.exports = { //piece = tokens[2] type = tokens[3] val = args[0].value - if(type != "volume_master") { + if((type == "volume_master") || (type == "volume_click") || (type == "out_audio") || (type == "out_click")) { + args = [{'type': 's', 'value': type}, {'type': 'f', 'value': val}] + } else { index = tokens[4] args = [{'type': 's', 'value': type}, {'type': 's', 'value': index}, {'type': 'f', 'value': val}] - } else { - args = [{'type': 's', 'value': type}, {'type': 'f', 'value': val}] } //args = [{'type': 's', 'value': piece}, {'type': 's', 'value': type}, {'type': 's', 'value': index}, {'type': 'f', 'value': val}] //console.log(data) diff --git a/live_utilities/openstagecontrol/mixer.json b/live_utilities/openstagecontrol/mixer.json index 54271c7..024279e 100644 --- a/live_utilities/openstagecontrol/mixer.json +++ b/live_utilities/openstagecontrol/mixer.json @@ -160,7 +160,7 @@ "interaction": true, "comments": "", "width": "100%", - "height": "100%", + "height": "95%", "expand": "false", "colorText": "auto", "colorWidget": "auto", @@ -204,6 +204,56 @@ "onCreate": "", "onValue": "", "onTouch": "" + }, + { + "type": "dropdown", + "top": "95%", + "left": 0, + "lock": false, + "id": "mixer/@{parent.variables.piece}/out_audio", + "visible": true, + "interaction": true, + "comments": "", + "width": "100%", + "height": "5%", + "expand": "false", + "colorText": "auto", + "colorWidget": "auto", + "colorStroke": "auto", + "colorFill": "auto", + "alphaStroke": "auto", + "alphaFillOff": "auto", + "alphaFillOn": "auto", + "lineWidth": "auto", + "borderRadius": "auto", + "padding": "auto", + "html": "", + "css": "", + "label": "auto", + "icon": "true", + "align": "center", + "values": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "value": "", + "default": 1, + "linkId": "", + "address": "auto", + "preArgs": "", + "typeTags": "", + "decimals": 0, + "target": "", + "ignoreDefaults": false, + "bypass": false, + "onCreate": "", + "onValue": "" } ], "tabs": [] @@ -369,7 +419,7 @@ "interaction": true, "comments": "", "width": "100%", - "height": "100%", + "height": "95%", "expand": "false", "colorText": "auto", "colorWidget": "auto", @@ -413,6 +463,56 @@ "onCreate": "", "onValue": "", "onTouch": "" + }, + { + "type": "dropdown", + "top": "95%", + "left": 0, + "lock": false, + "id": "mixer/@{parent.variables.piece}/out_click", + "visible": true, + "interaction": true, + "comments": "", + "width": "100%", + "height": "5%", + "expand": "false", + "colorText": "auto", + "colorWidget": "auto", + "colorStroke": "auto", + "colorFill": "auto", + "alphaStroke": "auto", + "alphaFillOff": "auto", + "alphaFillOn": "auto", + "lineWidth": "auto", + "borderRadius": "auto", + "padding": "auto", + "html": "", + "css": "", + "label": "auto", + "icon": "true", + "align": "center", + "values": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "value": "", + "default": 1, + "linkId": "", + "address": "auto", + "preArgs": "", + "typeTags": "", + "decimals": 0, + "target": "", + "ignoreDefaults": false, + "bypass": false, + "onCreate": "", + "onValue": "" } ], "tabs": [] diff --git a/live_utilities/openstagecontrol/mixer_transport.json b/live_utilities/openstagecontrol/mixer_transport.json index 3c5a52b..da3ede4 100644 --- a/live_utilities/openstagecontrol/mixer_transport.json +++ b/live_utilities/openstagecontrol/mixer_transport.json @@ -1012,7 +1012,7 @@ "scroll": true, "innerPadding": true, "tabsPosition": "top", - "label": "Jaendal", + "label": "Jaendel", "variables": "@{parent.variables}", "traversing": false, "value": "", @@ -1084,7 +1084,7 @@ "fallback": "", "props": { "variables": { - "piece": "kari", + "piece": "jaendel", "tempo": 60 } }, diff --git a/live_utilities/supercollider/live_utilities.scd b/live_utilities/supercollider/live_utilities.scd index 37d939e..a4fcf09 100644 --- a/live_utilities/supercollider/live_utilities.scd +++ b/live_utilities/supercollider/live_utilities.scd @@ -124,7 +124,7 @@ s.waitForBoot({ bergerCreatePatternsForLive = {arg seqs, group; var pBinds, cleanSeqs; cleanSeqs = [seqs[5], seqs[6], seqs[7], seqs[0], seqs[1], seqs[2]]; - pBinds = seqs.collect({arg r, i; + pBinds = cleanSeqs.collect({arg r, i; Pbind(\instrument, \berger, //\buf, Pseq((i - ((0..(r.slice(nil, 2).flat.size - 1)) / 10).trunc.asInteger) % 8), \group, group, @@ -219,12 +219,12 @@ s.waitForBoot({ [ Pbind(\instrument, \kariNoise, \group, group, - \out, 0, + \out, hdpBusArray[0], \dur, Pseq(dirs[0].slice(nil, 1) /* * 1.2*/), \snd, Pseq(dirs[0].slice(nil, 0))), Pbind(\instrument, \kariBass, \group, group, - \out, 1, + \out, hdpBusArray[1], \dur, Pseq(dirs[1].slice(nil, 1) /* * 1.2*/), \freq, Pseq((dirs[1].slice(nil, 0).collect({arg elem; [Rest(0), 36.midicps, 43.midicps][elem]})))), ] ++ @@ -232,7 +232,7 @@ s.waitForBoot({ dirs.drop(2).reverse.collect({arg row, i; Pbind(\instrument, \kariEnsemble, \group, group, - \out, i + 2, + \out, hdpBusArray[i + 2], \dur, Pseq(row.slice(nil, 1) /* * 1.2*/), //\sustain, Pseq(row.slice(nil, 1) * 1.2), \freq, Pseq(row.slice(nil, 0).collect({arg val; if(val == 5, {Rest(0)}, {(60 + (val.trunc * 7)).midicps})})), @@ -280,21 +280,6 @@ s.waitForBoot({ ); }; - SynthDef(\mixer_old, {arg freq, gate = 1, sustain, amp, dur, out; - var nameSpaces, sigs; - - sigs = [hdpBusArray].collect({arg busArray, i; - var nameSpace, sig; - nameSpace = ['hdp'][i]; - sig = busArray.collect({arg bus, c; In.ar(bus, 1) * NamedControl.kr(\ ++ nameSpace ++ '_volume_' ++ c, 1, 0.1)}); - sig = sig.collect({arg channel, c; Pan2.ar(channel, NamedControl.kr(\ ++ nameSpace ++ '_pan_' ++ c, i / (busArray.size - 1), 0.1) * 2 - 1)}); - sig = sig.collect({arg channel, c; channel * NamedControl.kr(\ ++ nameSpace ++ '_mute_' ++ c, 1, 0.1)}); - sig = Mix.ar(sig) * pow(NamedControl.kr(\ ++ nameSpace ++ '_volume_master', 1, 0.5), 2); - }); - - sigs = Mix.ar(sigs / 6); - Out.ar(0, sigs) - }).add; SynthDef(\mixer, { var sig, click; @@ -304,10 +289,10 @@ s.waitForBoot({ sig = sig.collect({arg channel, index; channel * NamedControl.kr(\mute_ ++ index, 1, 0.1)}); sig = Mix.ar(sig) * pow(NamedControl.kr(\volume_master, 0.75, 0.5), 2); - click = In.ar(clickBus, 1);// * NamedControl.kr(\volume_click, 0.75, 0.1); + click = In.ar(clickBus, 1) * NamedControl.kr(\volume_click, 0.75, 0.1); - Out.ar(0, sig); - Out.ar(2, click); + Out.ar(NamedControl.kr(\out_audio, 0, 0), sig); + Out.ar(NamedControl.kr(\out_click, 0, 0), click); }).add; @@ -389,11 +374,13 @@ s.waitForBoot({ OSCdef(\mixer, {arg msg, time, addr, port; - [msg, time, addr, port]; - if(msg[1].asString != "volume_master", { - mixer.set((msg[1] ++ '_' ++ msg[2]), msg[3]); + [msg, time, addr, port].postln; + if((msg[1].asString == "volume_master") || (msg[1].asString == "volume_click") || (msg[1].asString[..2] == "out"), { + var val = msg[2]; + if(msg[1].asString[..2] == "out", {val = val.round - 1}); + mixer.set(msg[1], val) }, { - mixer.set(msg[1], msg[2]) + mixer.set((msg[1] ++ '_' ++ msg[2]), msg[3]); }); }, \mixer);