diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..ac54905f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "keykit"] + path = keykit + url = https://github.com/nosuchtim/keykit.git diff --git a/.vscode/launch.json b/.vscode/launch.json index 7cff9e40..7f9f7272 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,11 +23,11 @@ "args": [] }, { - "name": "palette stop bidule", + "name": "palette start gui", "type": "go", "request": "launch", "program": "${env:PALETTESOURCE}/cmd/palette/palette.go", - "args": ["stop","bidule"] + "args": ["start","gui"] }, { "name": "palette gui", diff --git a/cmd/palette/palette.go b/cmd/palette/palette.go index d2b59b13..7c38f1b7 100644 --- a/cmd/palette/palette.go +++ b/cmd/palette/palette.go @@ -28,8 +28,8 @@ func main() { // Usage for controlling the "quadpro" (QuadPro) plugin func usage() string { return `Commands: - palette start [ engine | gui | bidule | resolume ] - palette stop [ engine | gui | bidule | resolume ] + palette start [ all | engine | gui | bidule | resolume ] + palette stop [ all | engine | gui | bidule | resolume ] palette version palette {plugin}.{api} [ {argname} {argvalue} ] ... ` @@ -92,7 +92,7 @@ func CliCommand(args []string) string { case "resolume": return doApi("quadpro.startprocess", "process", "resolume") - case "all": + case "", "all": s1 := doStartEngine() s2 := doApi("quadpro.startprocess", "process", "all") return s1 + "\n" + s2 @@ -109,6 +109,13 @@ func CliCommand(args []string) string { switch arg1 { + case "", "all": + _, err := engine.RemoteAPI("engine.stopall") + if err != nil { + return fmt.Sprintf("RemoteAPI: err=%s\n", err) + } + return "" + case "engine": _, err := engine.RemoteAPI("engine.stop") if err != nil { @@ -125,11 +132,6 @@ func CliCommand(args []string) string { case "resolume": return doApi("quadpro.stopprocess", "process", "resolume") - case "all": - s1 := doApi("quadpro.stopprocess", "process", "all") - s2 := doApi("engine.stop") - return s1 + "\n" + s2 - default: return usage() } @@ -150,7 +152,7 @@ func CliCommand(args []string) string { default: words := strings.Split(api, ".") if len(words) != 2 { - return "Invalid api format, expecting {plugin}.{api}" + return "Invalid api format, expecting {plugin}.{api}\n" + usage() } return doApi(api, args[1:]...) } diff --git a/data_omnisphere/config/paramdefs.json b/data_omnisphere/config/paramdefs.json index b02adc03..d6ccedc6 100644 --- a/data_omnisphere/config/paramdefs.json +++ b/data_omnisphere/config/paramdefs.json @@ -66,7 +66,7 @@ "misc.cursorstyle": {"valuetype":"string", "min":"cursorstyle", "max":"cursorstyle", "init":"retrigger", "comment":"# Cursor playing style" }, "misc.quantstyle": {"valuetype":"string", "min":"quantstyle", "max":"quantstyle", "init":"frets", "comment":"# Quantization style" }, -"misc.scale": {"valuetype":"string", "min":"scale", "max":"scale", "randmax":"newage", "init":"newage", "comment":"# Quantization style" }, +"misc.scale": {"valuetype":"string", "min":"scale", "max":"scale", "randmax":"newage", "init":"newage", "comment":"# scale name" }, "misc.usescale": {"valuetype":"bool", "min":"false", "max":"true", "init":"true", "comment":"# Use Scale" }, "misc.volstyle": {"valuetype":"string", "min":"volstyle", "max":"volstyle", "init":"pressure", "comment":"# Velocity style" }, "misc.logic_sound": {"valuetype":"string", "min":"logic_sound", "max":"logic_sound", "init":"true", "comment":"# Sound Logic" }, @@ -77,7 +77,11 @@ "misc.pitchfactor": {"valuetype": "float", "min": "0.1", "max": "10.0", "init": "1.0", "comment": "#" }, "misc.generatesound": {"valuetype":"bool", "min":"false", "max":"true", "init":"true", "comment":"# Enable Sound" }, "misc.generatevisual": {"valuetype":"bool", "min":"false", "max":"true", "init":"true", "comment":"# Enable Visual" }, +"misc.looping_fade": {"valuetype": "float", "min": "0.0", "max": "1.0", "init": "0.5", "comment": "# fade factor" }, +"misc.looping_on": {"valuetype":"bool", "min":"false", "max":"true", "init":"false", "comment":"# Looping is on" }, +"misc.looping_length": {"valuetype":"int", "min":"0", "max":"128", "init":"8", "comment":"# Loop length in beats" }, +"engine.oscoutput": {"valuetype":"bool", "min":"false", "max":"true", "init":"true", "comment":"#" }, "engine.debug": {"valuetype":"string", "min":"debug", "max":"debug", "init":"", "comment":"# Debugging" }, "engine.plugins": {"valuetype":"string", "min":"plugins", "max":"plugins", "init":"quadpro", "comment":"# Plugins to start" }, "engine.guilevel": {"valuetype":"string", "min":"guilevel", "max":"guilevel", "init":"0", "comment":"# GUI level" }, diff --git a/data_omnisphere/config/paramenums.json b/data_omnisphere/config/paramenums.json index 00561e84..52671393 100644 --- a/data_omnisphere/config/paramenums.json +++ b/data_omnisphere/config/paramenums.json @@ -3,7 +3,7 @@ "plugins": [ "", "quadpro" ], "guilevel": [ "0", "1", "2" ], "guiresize": [ "-800,0,800,1200", "100,100,800,1280", "" ], - "autostart": [ "gui,bidule,resolume", "bidule,resolume", "none" ], + "autostart": [ "gui", "none", "gui,bidule", "gui,resolume", "gui,bidule,resolume" ], "bidule": ["C:/Program Files/Plogue/Bidule/Bidule.exe", ""], "mmtt": ["kinect", "depthai", ""], "destination": [ ".", "A", "B", "C", "D" ], diff --git a/data_omnisphere/saved/patch/_Current.json b/data_omnisphere/saved/patch/_Current.json deleted file mode 100644 index 672b2300..00000000 --- a/data_omnisphere/saved/patch/_Current.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "params": { - "effect.1-blur":"false", - "effect.1-blur:blurxdistance":"0.791000", - "effect.1-blur:blurydistance":"0.774000", - "effect.1-blur:gaussian":"0.890000", - "effect.1-blur:quality":"0.274000", - "effect.1-displace":"false", - "effect.1-displace:threshold":"0.397000", - "effect.1-displace:xfactor":"0.443000", - "effect.1-displace:yfactor":"0.004000", - "effect.1-edgedetection":"false", - "effect.1-edgedetection:mode":"0.660000", - "effect.1-edgedetection:multiplier":"0.625000", - "effect.1-fragment":"false", - "effect.1-fragment:distance":"0.798000", - "effect.1-fragment:fragments":"0.750000", - "effect.1-fragment:fragrotationx":"0.565000", - "effect.1-fragment:fragrotationy":"0.869000", - "effect.1-fragment:fragrotationz":"0.929000", - "effect.1-fragment:fragscale":"1.000000", - "effect.1-fragment:rotation":"0.866000", - "effect.1-goo":"false", - "effect.1-goo:maxdistortionx":"1.000000", - "effect.1-goo:maxdistortiony":"1.000000", - "effect.1-goo:maxdistortionz":"1.000000", - "effect.1-goo:resolution":"16", - "effect.1-goo:shade":"1.000000", - "effect.1-goo:speed":"0.150000", - "effect.1-huerotate":"false", - "effect.1-huerotate:huerotate":"0.921000", - "effect.1-huerotate:huescale":"0.232000", - "effect.1-huerotate:satscale":"0.015000", - "effect.1-kaleidoscope":"true", - "effect.1-kaleidoscope:angles":"0.214000", - "effect.1-kaleidoscope:inputrotation":"0.102000", - "effect.1-kaleidoscope:opacity":"1.000000", - "effect.1-kaleidoscope:rotation":"0.386000", - "effect.1-kaleidoscope:zoom":"0.646000", - "effect.1-mirror":"false", - "effect.1-mirror:flipx":"1", - "effect.1-mirror:flipy":"0", - "effect.1-mirror:in/out":"0.681000", - "effect.1-mirror:x":"0.500000", - "effect.1-mirror:y":"0.500000", - "effect.1-mirrorquad":"false", - "effect.1-mirrorquad:flipx":"1", - "effect.1-mirrorquad:flipy":"0", - "effect.1-posterize":"false", - "effect.1-posterize:posterize":"0.139000", - "effect.1-trails":"false", - "effect.1-trails:feedback":"0.550000", - "effect.1-twisted":"false", - "effect.1-twisted:radius":"0.588000", - "effect.1-twisted:twirl":"0.408000", - "effect.2-blur":"false", - "effect.2-blur:blurxdistance":"0.421000", - "effect.2-blur:blurydistance":"0.169000", - "effect.2-blur:gaussian":"0.726000", - "effect.2-blur:quality":"0.484000", - "effect.2-displace":"true", - "effect.2-displace:threshold":"0.288000", - "effect.2-displace:xfactor":"0.075000", - "effect.2-displace:yfactor":"0.095000", - "effect.2-edgedetection":"false", - "effect.2-edgedetection:mode":"0.065000", - "effect.2-edgedetection:multiplier":"0.811000", - "effect.2-fragment":"false", - "effect.2-fragment:distance":"0.785000", - "effect.2-fragment:fragments":"0.431000", - "effect.2-fragment:fragrotationx":"0.790000", - "effect.2-fragment:fragrotationy":"0.277000", - "effect.2-fragment:fragrotationz":"0.813000", - "effect.2-fragment:fragscale":"1.000000", - "effect.2-fragment:rotation":"0.994000", - "effect.2-goo":"false", - "effect.2-goo:maxdistortionx":"1.000000", - "effect.2-goo:maxdistortiony":"1.000000", - "effect.2-goo:maxdistortionz":"1.000000", - "effect.2-goo:resolution":"16", - "effect.2-goo:shade":"1.000000", - "effect.2-goo:speed":"0.150000", - "effect.2-huerotate":"false", - "effect.2-huerotate:huerotate":"0.762000", - "effect.2-huerotate:huescale":"0.319000", - "effect.2-huerotate:satscale":"0.073000", - "effect.2-kaleidoscope":"false", - "effect.2-kaleidoscope:angles":"0.685000", - "effect.2-kaleidoscope:inputrotation":"0.059000", - "effect.2-kaleidoscope:opacity":"1.000000", - "effect.2-kaleidoscope:rotation":"0.780000", - "effect.2-kaleidoscope:zoom":"0.051000", - "effect.2-mirror":"false", - "effect.2-mirror:flipx":"0", - "effect.2-mirror:flipy":"0", - "effect.2-mirror:in/out":"0.234000", - "effect.2-mirror:x":"0.500000", - "effect.2-mirror:y":"0.500000", - "effect.2-mirrorquad":"false", - "effect.2-mirrorquad:flipx":"1", - "effect.2-mirrorquad:flipy":"0", - "effect.2-posterize":"false", - "effect.2-posterize:posterize":"0.215000", - "effect.2-trails":"false", - "effect.2-trails:feedback":"0.550000", - "effect.2-twisted":"false", - "effect.2-twisted:radius":"0.500000", - "effect.2-twisted:twirl":"0.102000", - "misc.cursorstyle":"", - "misc.enable:sound":"true", - "misc.enable:visual":"true", - "misc.logic_sound":"true", - "misc.logic_visual":"true", - "misc.midibehaviour":"default", - "misc.midiinputpatch":"A", - "misc.pitchfactor":"1.000000", - "misc.pitchoffset":"0.000000", - "misc.quantstyle":"frets", - "misc.scale":"newage", - "misc.usescale":"true", - "misc.vol":"pressure", - "sound._controllermax":"127", - "sound._controllermin":"1", - "sound._controllerzmax":"0.300000", - "sound._controllerzmin":"0.050000", - "sound._deltaytrig":"1.000000", - "sound._deltaztrig":"1.000000", - "sound._inputport":"", - "sound._timefret1q":"1.000000", - "sound._timefret1y":"0.150000", - "sound._timefret2q":"0.500000", - "sound._timefret2y":"0.500000", - "sound._timefret3q":"0.250000", - "sound._timefret3y":"0.800000", - "sound._timefret4q":"0.125000", - "sound._timefret4y":"1.000000", - "sound.chromatic":"false", - "sound.controllerstyle":"modulationonly", - "sound.midifile":"jsbach", - "sound.pitchmax":"80", - "sound.pitchmin":"33", - "sound.synth":"P_06_C_06", - "sound.velocitymax":"127", - "sound.velocitymin":"1", - "sound.xcontroller":"3", - "sound.ycontroller":"2", - "sound.zcontroller":"1", - "visual.alphafinal":"0.000000", - "visual.alphainitial":"0.700000", - "visual.alphatime":"2.297000", - "visual.aspect":"0.500000", - "visual.bounce":"false", - "visual.cursorsprites":"false", - "visual.filled":"false", - "visual.gravity":"0", - "visual.hue1final":"360.000000", - "visual.hue1initial":"360.000000", - "visual.hue1time":"5.000000", - "visual.hue2final":"360.000000", - "visual.hue2initial":"360.000000", - "visual.hue2time":"5.000000", - "visual.inputbackground":"false", - "visual.justification":"center", - "visual.lifetime":"10.000000", - "visual.luminance":"0.500000", - "visual.mirrortype":"four", - "visual.movedir":"cursor", - "visual.noisevertex":"0.000000", - "visual.noisevertexx":"0.000000", - "visual.noisevertexy":"0.000000", - "visual.nsprites":"129", - "visual.placement":"cursor", - "visual.rotangdir":"left", - "visual.rotanginit":"90.000000", - "visual.rotangspeed":"24.000000", - "visual.rotauto":"true", - "visual.saturation":"1.000000", - "visual.shape":"circle", - "visual.sizefinal":"0.000000", - "visual.sizeinitial":"4.997000", - "visual.sizetime":"7.103000", - "visual.smoothxyz":"10", - "visual.speed":"0.010000", - "visual.spritesource":"cursor", - "visual.spritestyle":"hue", - "visual.thickness":"2.008000", - "visual.zmin":"0.004000" - } -} \ No newline at end of file diff --git a/data_omnisphere/saved/quad/_Current.json b/data_omnisphere/saved/quad/_Current.json index 623e6c49..a1f981b6 100644 --- a/data_omnisphere/saved/quad/_Current.json +++ b/data_omnisphere/saved/quad/_Current.json @@ -1,25 +1,25 @@ { "params": { - "A-effect.1-blur":"false", + "A-effect.1-blur":"true", "A-effect.1-blur:blurxdistance":"0.100000", "A-effect.1-blur:blurydistance":"0.080000", "A-effect.1-blur:gaussian":"0.170000", "A-effect.1-blur:quality":"0.280000", - "A-effect.1-displace":"false", - "A-effect.1-displace:threshold":"0.397000", + "A-effect.1-displace":"true", + "A-effect.1-displace:threshold":"0.000000", "A-effect.1-displace:xfactor":"0.760000", "A-effect.1-displace:yfactor":"0.240000", "A-effect.1-edgedetection":"false", "A-effect.1-edgedetection:mode":"0.920000", "A-effect.1-edgedetection:multiplier":"0.240000", "A-effect.1-fragment":"false", - "A-effect.1-fragment:distance":"0.798000", - "A-effect.1-fragment:fragments":"0.750000", - "A-effect.1-fragment:fragrotationx":"0.565000", - "A-effect.1-fragment:fragrotationy":"0.869000", - "A-effect.1-fragment:fragrotationz":"0.929000", + "A-effect.1-fragment:distance":"0.330000", + "A-effect.1-fragment:fragments":"0.300000", + "A-effect.1-fragment:fragrotationx":"0.500000", + "A-effect.1-fragment:fragrotationy":"0.500000", + "A-effect.1-fragment:fragrotationz":"0.500000", "A-effect.1-fragment:fragscale":"1.000000", - "A-effect.1-fragment:rotation":"0.866000", + "A-effect.1-fragment:rotation":"0.000000", "A-effect.1-goo":"false", "A-effect.1-goo:maxdistortionx":"1.000000", "A-effect.1-goo:maxdistortiony":"1.000000", @@ -28,9 +28,9 @@ "A-effect.1-goo:shade":"1.000000", "A-effect.1-goo:speed":"0.150000", "A-effect.1-huerotate":"false", - "A-effect.1-huerotate:huerotate":"0.921000", - "A-effect.1-huerotate:huescale":"0.232000", - "A-effect.1-huerotate:satscale":"0.015000", + "A-effect.1-huerotate:huerotate":"0.000000", + "A-effect.1-huerotate:huescale":"1.000000", + "A-effect.1-huerotate:satscale":"0.500000", "A-effect.1-kaleidoscope":"false", "A-effect.1-kaleidoscope:angles":"0.300000", "A-effect.1-kaleidoscope:inputrotation":"0.500000", @@ -38,17 +38,17 @@ "A-effect.1-kaleidoscope:rotation":"0.000000", "A-effect.1-kaleidoscope:zoom":"0.580000", "A-effect.1-mirror":"false", - "A-effect.1-mirror:flipx":"1", + "A-effect.1-mirror:flipx":"0", "A-effect.1-mirror:flipy":"0", - "A-effect.1-mirror:in/out":"0.681000", + "A-effect.1-mirror:in/out":"1.000000", "A-effect.1-mirror:x":"0.500000", "A-effect.1-mirror:y":"0.500000", "A-effect.1-mirrorquad":"false", - "A-effect.1-mirrorquad:flipx":"1", + "A-effect.1-mirrorquad:flipx":"0", "A-effect.1-mirrorquad:flipy":"0", "A-effect.1-posterize":"false", "A-effect.1-posterize:posterize":"0.190000", - "A-effect.1-trails":"false", + "A-effect.1-trails":"true", "A-effect.1-trails:feedback":"0.550000", "A-effect.1-twisted":"false", "A-effect.1-twisted:radius":"0.310000", @@ -59,20 +59,20 @@ "A-effect.2-blur:gaussian":"0.170000", "A-effect.2-blur:quality":"0.280000", "A-effect.2-displace":"false", - "A-effect.2-displace:threshold":"0.288000", + "A-effect.2-displace:threshold":"0.000000", "A-effect.2-displace:xfactor":"0.760000", "A-effect.2-displace:yfactor":"0.240000", "A-effect.2-edgedetection":"false", "A-effect.2-edgedetection:mode":"0.920000", "A-effect.2-edgedetection:multiplier":"0.240000", "A-effect.2-fragment":"false", - "A-effect.2-fragment:distance":"0.785000", - "A-effect.2-fragment:fragments":"0.431000", - "A-effect.2-fragment:fragrotationx":"0.790000", - "A-effect.2-fragment:fragrotationy":"0.277000", - "A-effect.2-fragment:fragrotationz":"0.813000", + "A-effect.2-fragment:distance":"0.330000", + "A-effect.2-fragment:fragments":"0.300000", + "A-effect.2-fragment:fragrotationx":"0.500000", + "A-effect.2-fragment:fragrotationy":"0.500000", + "A-effect.2-fragment:fragrotationz":"0.500000", "A-effect.2-fragment:fragscale":"1.000000", - "A-effect.2-fragment:rotation":"0.994000", + "A-effect.2-fragment:rotation":"0.000000", "A-effect.2-goo":"false", "A-effect.2-goo:maxdistortionx":"1.000000", "A-effect.2-goo:maxdistortiony":"1.000000", @@ -81,9 +81,9 @@ "A-effect.2-goo:shade":"1.000000", "A-effect.2-goo:speed":"0.150000", "A-effect.2-huerotate":"false", - "A-effect.2-huerotate:huerotate":"0.762000", - "A-effect.2-huerotate:huescale":"0.319000", - "A-effect.2-huerotate:satscale":"0.073000", + "A-effect.2-huerotate:huerotate":"0.000000", + "A-effect.2-huerotate:huescale":"1.000000", + "A-effect.2-huerotate:satscale":"0.500000", "A-effect.2-kaleidoscope":"false", "A-effect.2-kaleidoscope:angles":"0.640000", "A-effect.2-kaleidoscope:inputrotation":"0.500000", @@ -93,11 +93,11 @@ "A-effect.2-mirror":"false", "A-effect.2-mirror:flipx":"0", "A-effect.2-mirror:flipy":"0", - "A-effect.2-mirror:in/out":"0.234000", + "A-effect.2-mirror:in/out":"1.000000", "A-effect.2-mirror:x":"0.500000", "A-effect.2-mirror:y":"0.500000", "A-effect.2-mirrorquad":"false", - "A-effect.2-mirrorquad:flipx":"1", + "A-effect.2-mirrorquad:flipx":"0", "A-effect.2-mirrorquad:flipy":"0", "A-effect.2-posterize":"false", "A-effect.2-posterize:posterize":"0.190000", @@ -111,6 +111,9 @@ "A-misc.generatevisual":"true", "A-misc.logic_sound":"true", "A-misc.logic_visual":"true", + "A-misc.looping_fade":"0.500000", + "A-misc.looping_length":"8", + "A-misc.looping_on":"false", "A-misc.midibehaviour":"default", "A-misc.midiinputpatch":"A", "A-misc.pitchfactor":"1.000000", @@ -137,9 +140,9 @@ "A-sound.chromatic":"false", "A-sound.controllerstyle":"modulationonly", "A-sound.midifile":"jsbach", - "A-sound.pitchmax":"72", - "A-sound.pitchmin":"25", - "A-sound.synth":"P_10_C_06", + "A-sound.pitchmax":"59", + "A-sound.pitchmin":"36", + "A-sound.synth":"P_04_C_10", "A-sound.velocitymax":"127", "A-sound.velocitymin":"48", "A-sound.xcontroller":"1", @@ -176,35 +179,35 @@ "A-visual.rotauto":"false", "A-visual.saturation":"1.000000", "A-visual.shape":"square", - "A-visual.sizefinal":"0.000000", + "A-visual.sizefinal":"0.400000", "A-visual.sizeinitial":"2.008000", - "A-visual.sizetime":"1.280000", + "A-visual.sizetime":"1.580000", "A-visual.smoothxyz":"3", "A-visual.speed":"0.000000", "A-visual.spritesource":"cursor", "A-visual.spritestyle":"hue", "A-visual.thickness":"3.007000", "A-visual.zmin":"0.004000", - "B-effect.1-blur":"false", + "B-effect.1-blur":"true", "B-effect.1-blur:blurxdistance":"0.100000", "B-effect.1-blur:blurydistance":"0.080000", "B-effect.1-blur:gaussian":"0.170000", "B-effect.1-blur:quality":"0.280000", - "B-effect.1-displace":"false", - "B-effect.1-displace:threshold":"0.212000", + "B-effect.1-displace":"true", + "B-effect.1-displace:threshold":"0.000000", "B-effect.1-displace:xfactor":"0.760000", "B-effect.1-displace:yfactor":"0.240000", "B-effect.1-edgedetection":"false", "B-effect.1-edgedetection:mode":"0.920000", "B-effect.1-edgedetection:multiplier":"0.240000", "B-effect.1-fragment":"false", - "B-effect.1-fragment:distance":"0.563000", - "B-effect.1-fragment:fragments":"0.386000", - "B-effect.1-fragment:fragrotationx":"0.729000", - "B-effect.1-fragment:fragrotationy":"0.480000", - "B-effect.1-fragment:fragrotationz":"0.163000", + "B-effect.1-fragment:distance":"0.330000", + "B-effect.1-fragment:fragments":"0.300000", + "B-effect.1-fragment:fragrotationx":"0.500000", + "B-effect.1-fragment:fragrotationy":"0.500000", + "B-effect.1-fragment:fragrotationz":"0.500000", "B-effect.1-fragment:fragscale":"1.000000", - "B-effect.1-fragment:rotation":"0.972000", + "B-effect.1-fragment:rotation":"0.000000", "B-effect.1-goo":"false", "B-effect.1-goo:maxdistortionx":"1.000000", "B-effect.1-goo:maxdistortiony":"1.000000", @@ -213,9 +216,9 @@ "B-effect.1-goo:shade":"1.000000", "B-effect.1-goo:speed":"0.150000", "B-effect.1-huerotate":"false", - "B-effect.1-huerotate:huerotate":"0.225000", - "B-effect.1-huerotate:huescale":"0.582000", - "B-effect.1-huerotate:satscale":"0.195000", + "B-effect.1-huerotate:huerotate":"0.000000", + "B-effect.1-huerotate:huescale":"1.000000", + "B-effect.1-huerotate:satscale":"0.500000", "B-effect.1-kaleidoscope":"false", "B-effect.1-kaleidoscope:angles":"0.300000", "B-effect.1-kaleidoscope:inputrotation":"0.500000", @@ -223,17 +226,17 @@ "B-effect.1-kaleidoscope:rotation":"0.000000", "B-effect.1-kaleidoscope:zoom":"0.580000", "B-effect.1-mirror":"false", - "B-effect.1-mirror:flipx":"1", - "B-effect.1-mirror:flipy":"1", - "B-effect.1-mirror:in/out":"0.822000", + "B-effect.1-mirror:flipx":"0", + "B-effect.1-mirror:flipy":"0", + "B-effect.1-mirror:in/out":"1.000000", "B-effect.1-mirror:x":"0.500000", "B-effect.1-mirror:y":"0.500000", "B-effect.1-mirrorquad":"false", - "B-effect.1-mirrorquad:flipx":"1", + "B-effect.1-mirrorquad:flipx":"0", "B-effect.1-mirrorquad:flipy":"0", "B-effect.1-posterize":"false", "B-effect.1-posterize:posterize":"0.190000", - "B-effect.1-trails":"false", + "B-effect.1-trails":"true", "B-effect.1-trails:feedback":"0.550000", "B-effect.1-twisted":"false", "B-effect.1-twisted:radius":"0.310000", @@ -244,20 +247,20 @@ "B-effect.2-blur:gaussian":"0.170000", "B-effect.2-blur:quality":"0.280000", "B-effect.2-displace":"false", - "B-effect.2-displace:threshold":"0.027000", + "B-effect.2-displace:threshold":"0.000000", "B-effect.2-displace:xfactor":"0.760000", "B-effect.2-displace:yfactor":"0.240000", "B-effect.2-edgedetection":"false", "B-effect.2-edgedetection:mode":"0.920000", "B-effect.2-edgedetection:multiplier":"0.240000", "B-effect.2-fragment":"false", - "B-effect.2-fragment:distance":"0.058000", - "B-effect.2-fragment:fragments":"0.902000", - "B-effect.2-fragment:fragrotationx":"0.681000", - "B-effect.2-fragment:fragrotationy":"0.132000", - "B-effect.2-fragment:fragrotationz":"0.247000", + "B-effect.2-fragment:distance":"0.330000", + "B-effect.2-fragment:fragments":"0.300000", + "B-effect.2-fragment:fragrotationx":"0.500000", + "B-effect.2-fragment:fragrotationy":"0.500000", + "B-effect.2-fragment:fragrotationz":"0.500000", "B-effect.2-fragment:fragscale":"1.000000", - "B-effect.2-fragment:rotation":"0.476000", + "B-effect.2-fragment:rotation":"0.000000", "B-effect.2-goo":"false", "B-effect.2-goo:maxdistortionx":"1.000000", "B-effect.2-goo:maxdistortiony":"1.000000", @@ -266,9 +269,9 @@ "B-effect.2-goo:shade":"1.000000", "B-effect.2-goo:speed":"0.150000", "B-effect.2-huerotate":"false", - "B-effect.2-huerotate:huerotate":"0.897000", - "B-effect.2-huerotate:huescale":"0.131000", - "B-effect.2-huerotate:satscale":"0.095000", + "B-effect.2-huerotate:huerotate":"0.000000", + "B-effect.2-huerotate:huescale":"1.000000", + "B-effect.2-huerotate:satscale":"0.500000", "B-effect.2-kaleidoscope":"false", "B-effect.2-kaleidoscope:angles":"0.640000", "B-effect.2-kaleidoscope:inputrotation":"0.500000", @@ -276,13 +279,13 @@ "B-effect.2-kaleidoscope:rotation":"0.000000", "B-effect.2-kaleidoscope:zoom":"1.000000", "B-effect.2-mirror":"false", - "B-effect.2-mirror:flipx":"1", + "B-effect.2-mirror:flipx":"0", "B-effect.2-mirror:flipy":"0", - "B-effect.2-mirror:in/out":"0.041000", + "B-effect.2-mirror:in/out":"1.000000", "B-effect.2-mirror:x":"0.500000", "B-effect.2-mirror:y":"0.500000", "B-effect.2-mirrorquad":"false", - "B-effect.2-mirrorquad:flipx":"1", + "B-effect.2-mirrorquad:flipx":"0", "B-effect.2-mirrorquad:flipy":"0", "B-effect.2-posterize":"false", "B-effect.2-posterize:posterize":"0.190000", @@ -296,6 +299,9 @@ "B-misc.generatevisual":"true", "B-misc.logic_sound":"true", "B-misc.logic_visual":"true", + "B-misc.looping_fade":"0.500000", + "B-misc.looping_length":"8", + "B-misc.looping_on":"false", "B-misc.midibehaviour":"default", "B-misc.midiinputpatch":"A", "B-misc.pitchfactor":"1.000000", @@ -322,13 +328,13 @@ "B-sound.chromatic":"false", "B-sound.controllerstyle":"modulationonly", "B-sound.midifile":"jsbach", - "B-sound.pitchmax":"72", - "B-sound.pitchmin":"25", - "B-sound.synth":"P_10_C_06", - "B-sound.velocitymax":"126", + "B-sound.pitchmax":"59", + "B-sound.pitchmin":"36", + "B-sound.synth":"P_02_C_10", + "B-sound.velocitymax":"127", "B-sound.velocitymin":"48", - "B-sound.xcontroller":"1", - "B-sound.ycontroller":"1", + "B-sound.xcontroller":"3", + "B-sound.ycontroller":"2", "B-sound.zcontroller":"1", "B-visual.alphafinal":"0.100000", "B-visual.alphainitial":"0.510000", @@ -363,33 +369,33 @@ "B-visual.shape":"square", "B-visual.sizefinal":"0.000000", "B-visual.sizeinitial":"2.498000", - "B-visual.sizetime":"1.500000", + "B-visual.sizetime":"1.580000", "B-visual.smoothxyz":"3", "B-visual.speed":"0.000000", "B-visual.spritesource":"cursor", "B-visual.spritestyle":"hue", "B-visual.thickness":"3.000000", "B-visual.zmin":"0.004000", - "C-effect.1-blur":"false", + "C-effect.1-blur":"true", "C-effect.1-blur:blurxdistance":"0.100000", "C-effect.1-blur:blurydistance":"0.080000", "C-effect.1-blur:gaussian":"0.170000", "C-effect.1-blur:quality":"0.280000", - "C-effect.1-displace":"false", - "C-effect.1-displace:threshold":"0.221000", + "C-effect.1-displace":"true", + "C-effect.1-displace:threshold":"0.000000", "C-effect.1-displace:xfactor":"0.760000", "C-effect.1-displace:yfactor":"0.240000", "C-effect.1-edgedetection":"false", "C-effect.1-edgedetection:mode":"0.920000", "C-effect.1-edgedetection:multiplier":"0.240000", "C-effect.1-fragment":"false", - "C-effect.1-fragment:distance":"0.839000", - "C-effect.1-fragment:fragments":"0.876000", - "C-effect.1-fragment:fragrotationx":"0.078000", - "C-effect.1-fragment:fragrotationy":"0.377000", - "C-effect.1-fragment:fragrotationz":"0.848000", - "C-effect.1-fragment:fragscale":"0.253000", - "C-effect.1-fragment:rotation":"0.588000", + "C-effect.1-fragment:distance":"0.330000", + "C-effect.1-fragment:fragments":"0.300000", + "C-effect.1-fragment:fragrotationx":"0.500000", + "C-effect.1-fragment:fragrotationy":"0.500000", + "C-effect.1-fragment:fragrotationz":"0.500000", + "C-effect.1-fragment:fragscale":"1.000000", + "C-effect.1-fragment:rotation":"0.000000", "C-effect.1-goo":"false", "C-effect.1-goo:maxdistortionx":"1.000000", "C-effect.1-goo:maxdistortiony":"1.000000", @@ -398,9 +404,9 @@ "C-effect.1-goo:shade":"1.000000", "C-effect.1-goo:speed":"0.150000", "C-effect.1-huerotate":"false", - "C-effect.1-huerotate:huerotate":"0.787000", - "C-effect.1-huerotate:huescale":"0.849000", - "C-effect.1-huerotate:satscale":"0.445000", + "C-effect.1-huerotate:huerotate":"0.000000", + "C-effect.1-huerotate:huescale":"1.000000", + "C-effect.1-huerotate:satscale":"0.500000", "C-effect.1-kaleidoscope":"false", "C-effect.1-kaleidoscope:angles":"0.300000", "C-effect.1-kaleidoscope:inputrotation":"0.500000", @@ -410,7 +416,7 @@ "C-effect.1-mirror":"false", "C-effect.1-mirror:flipx":"0", "C-effect.1-mirror:flipy":"0", - "C-effect.1-mirror:in/out":"0.233000", + "C-effect.1-mirror:in/out":"1.000000", "C-effect.1-mirror:x":"0.500000", "C-effect.1-mirror:y":"0.500000", "C-effect.1-mirrorquad":"false", @@ -418,7 +424,7 @@ "C-effect.1-mirrorquad:flipy":"0", "C-effect.1-posterize":"false", "C-effect.1-posterize:posterize":"0.190000", - "C-effect.1-trails":"false", + "C-effect.1-trails":"true", "C-effect.1-trails:feedback":"0.550000", "C-effect.1-twisted":"false", "C-effect.1-twisted:radius":"0.310000", @@ -429,20 +435,20 @@ "C-effect.2-blur:gaussian":"0.170000", "C-effect.2-blur:quality":"0.280000", "C-effect.2-displace":"false", - "C-effect.2-displace:threshold":"0.220000", + "C-effect.2-displace:threshold":"0.000000", "C-effect.2-displace:xfactor":"0.760000", "C-effect.2-displace:yfactor":"0.240000", "C-effect.2-edgedetection":"false", "C-effect.2-edgedetection:mode":"0.920000", "C-effect.2-edgedetection:multiplier":"0.240000", "C-effect.2-fragment":"false", - "C-effect.2-fragment:distance":"0.528000", - "C-effect.2-fragment:fragments":"0.892000", - "C-effect.2-fragment:fragrotationx":"0.041000", - "C-effect.2-fragment:fragrotationy":"0.702000", - "C-effect.2-fragment:fragrotationz":"0.102000", - "C-effect.2-fragment:fragscale":"0.870000", - "C-effect.2-fragment:rotation":"0.225000", + "C-effect.2-fragment:distance":"0.330000", + "C-effect.2-fragment:fragments":"0.300000", + "C-effect.2-fragment:fragrotationx":"0.500000", + "C-effect.2-fragment:fragrotationy":"0.500000", + "C-effect.2-fragment:fragrotationz":"0.500000", + "C-effect.2-fragment:fragscale":"1.000000", + "C-effect.2-fragment:rotation":"0.000000", "C-effect.2-goo":"false", "C-effect.2-goo:maxdistortionx":"1.000000", "C-effect.2-goo:maxdistortiony":"1.000000", @@ -451,9 +457,9 @@ "C-effect.2-goo:shade":"1.000000", "C-effect.2-goo:speed":"0.150000", "C-effect.2-huerotate":"false", - "C-effect.2-huerotate:huerotate":"0.680000", - "C-effect.2-huerotate:huescale":"0.166000", - "C-effect.2-huerotate:satscale":"0.081000", + "C-effect.2-huerotate:huerotate":"0.000000", + "C-effect.2-huerotate:huescale":"1.000000", + "C-effect.2-huerotate:satscale":"0.500000", "C-effect.2-kaleidoscope":"false", "C-effect.2-kaleidoscope:angles":"0.640000", "C-effect.2-kaleidoscope:inputrotation":"0.500000", @@ -463,12 +469,12 @@ "C-effect.2-mirror":"false", "C-effect.2-mirror:flipx":"0", "C-effect.2-mirror:flipy":"0", - "C-effect.2-mirror:in/out":"0.426000", + "C-effect.2-mirror:in/out":"1.000000", "C-effect.2-mirror:x":"0.500000", "C-effect.2-mirror:y":"0.500000", "C-effect.2-mirrorquad":"false", - "C-effect.2-mirrorquad:flipx":"1", - "C-effect.2-mirrorquad:flipy":"1", + "C-effect.2-mirrorquad:flipx":"0", + "C-effect.2-mirrorquad:flipy":"0", "C-effect.2-posterize":"false", "C-effect.2-posterize:posterize":"0.190000", "C-effect.2-trails":"false", @@ -481,6 +487,9 @@ "C-misc.generatevisual":"true", "C-misc.logic_sound":"true", "C-misc.logic_visual":"true", + "C-misc.looping_fade":"0.500000", + "C-misc.looping_length":"8", + "C-misc.looping_on":"false", "C-misc.midibehaviour":"default", "C-misc.midiinputpatch":"A", "C-misc.pitchfactor":"1.000000", @@ -507,9 +516,9 @@ "C-sound.chromatic":"false", "C-sound.controllerstyle":"modulationonly", "C-sound.midifile":"jsbach", - "C-sound.pitchmax":"72", - "C-sound.pitchmin":"25", - "C-sound.synth":"P_10_C_07", + "C-sound.pitchmax":"59", + "C-sound.pitchmin":"36", + "C-sound.synth":"P_06_C_10", "C-sound.velocitymax":"127", "C-sound.velocitymin":"45", "C-sound.xcontroller":"1", @@ -548,33 +557,33 @@ "C-visual.shape":"square", "C-visual.sizefinal":"0.000000", "C-visual.sizeinitial":"1.301000", - "C-visual.sizetime":"0.809000", + "C-visual.sizetime":"1.580000", "C-visual.smoothxyz":"3", "C-visual.speed":"0.000000", "C-visual.spritesource":"cursor", "C-visual.spritestyle":"hue", "C-visual.thickness":"10.000000", "C-visual.zmin":"0.004000", - "D-effect.1-blur":"false", + "D-effect.1-blur":"true", "D-effect.1-blur:blurxdistance":"0.100000", "D-effect.1-blur:blurydistance":"0.080000", "D-effect.1-blur:gaussian":"0.170000", "D-effect.1-blur:quality":"0.280000", - "D-effect.1-displace":"false", - "D-effect.1-displace:threshold":"0.397000", + "D-effect.1-displace":"true", + "D-effect.1-displace:threshold":"0.000000", "D-effect.1-displace:xfactor":"0.760000", "D-effect.1-displace:yfactor":"0.240000", "D-effect.1-edgedetection":"false", "D-effect.1-edgedetection:mode":"0.920000", "D-effect.1-edgedetection:multiplier":"0.240000", "D-effect.1-fragment":"false", - "D-effect.1-fragment:distance":"0.798000", - "D-effect.1-fragment:fragments":"0.750000", - "D-effect.1-fragment:fragrotationx":"0.565000", - "D-effect.1-fragment:fragrotationy":"0.869000", - "D-effect.1-fragment:fragrotationz":"0.929000", + "D-effect.1-fragment:distance":"0.330000", + "D-effect.1-fragment:fragments":"0.300000", + "D-effect.1-fragment:fragrotationx":"0.500000", + "D-effect.1-fragment:fragrotationy":"0.500000", + "D-effect.1-fragment:fragrotationz":"0.500000", "D-effect.1-fragment:fragscale":"1.000000", - "D-effect.1-fragment:rotation":"0.866000", + "D-effect.1-fragment:rotation":"0.000000", "D-effect.1-goo":"false", "D-effect.1-goo:maxdistortionx":"1.000000", "D-effect.1-goo:maxdistortiony":"1.000000", @@ -583,9 +592,9 @@ "D-effect.1-goo:shade":"1.000000", "D-effect.1-goo:speed":"0.150000", "D-effect.1-huerotate":"false", - "D-effect.1-huerotate:huerotate":"0.921000", - "D-effect.1-huerotate:huescale":"0.232000", - "D-effect.1-huerotate:satscale":"0.015000", + "D-effect.1-huerotate:huerotate":"0.000000", + "D-effect.1-huerotate:huescale":"1.000000", + "D-effect.1-huerotate:satscale":"0.500000", "D-effect.1-kaleidoscope":"false", "D-effect.1-kaleidoscope:angles":"0.300000", "D-effect.1-kaleidoscope:inputrotation":"0.500000", @@ -593,17 +602,17 @@ "D-effect.1-kaleidoscope:rotation":"0.000000", "D-effect.1-kaleidoscope:zoom":"0.580000", "D-effect.1-mirror":"false", - "D-effect.1-mirror:flipx":"1", + "D-effect.1-mirror:flipx":"0", "D-effect.1-mirror:flipy":"0", - "D-effect.1-mirror:in/out":"0.681000", + "D-effect.1-mirror:in/out":"1.000000", "D-effect.1-mirror:x":"0.500000", "D-effect.1-mirror:y":"0.500000", "D-effect.1-mirrorquad":"false", - "D-effect.1-mirrorquad:flipx":"1", + "D-effect.1-mirrorquad:flipx":"0", "D-effect.1-mirrorquad:flipy":"0", "D-effect.1-posterize":"false", "D-effect.1-posterize:posterize":"0.190000", - "D-effect.1-trails":"false", + "D-effect.1-trails":"true", "D-effect.1-trails:feedback":"0.550000", "D-effect.1-twisted":"false", "D-effect.1-twisted:radius":"0.310000", @@ -614,20 +623,20 @@ "D-effect.2-blur:gaussian":"0.170000", "D-effect.2-blur:quality":"0.280000", "D-effect.2-displace":"false", - "D-effect.2-displace:threshold":"0.288000", + "D-effect.2-displace:threshold":"0.000000", "D-effect.2-displace:xfactor":"0.760000", "D-effect.2-displace:yfactor":"0.240000", "D-effect.2-edgedetection":"false", "D-effect.2-edgedetection:mode":"0.920000", "D-effect.2-edgedetection:multiplier":"0.240000", "D-effect.2-fragment":"false", - "D-effect.2-fragment:distance":"0.785000", - "D-effect.2-fragment:fragments":"0.431000", - "D-effect.2-fragment:fragrotationx":"0.790000", - "D-effect.2-fragment:fragrotationy":"0.277000", - "D-effect.2-fragment:fragrotationz":"0.813000", + "D-effect.2-fragment:distance":"0.330000", + "D-effect.2-fragment:fragments":"0.300000", + "D-effect.2-fragment:fragrotationx":"0.500000", + "D-effect.2-fragment:fragrotationy":"0.500000", + "D-effect.2-fragment:fragrotationz":"0.500000", "D-effect.2-fragment:fragscale":"1.000000", - "D-effect.2-fragment:rotation":"0.994000", + "D-effect.2-fragment:rotation":"0.000000", "D-effect.2-goo":"false", "D-effect.2-goo:maxdistortionx":"1.000000", "D-effect.2-goo:maxdistortiony":"1.000000", @@ -636,9 +645,9 @@ "D-effect.2-goo:shade":"1.000000", "D-effect.2-goo:speed":"0.150000", "D-effect.2-huerotate":"false", - "D-effect.2-huerotate:huerotate":"0.762000", - "D-effect.2-huerotate:huescale":"0.319000", - "D-effect.2-huerotate:satscale":"0.073000", + "D-effect.2-huerotate:huerotate":"0.000000", + "D-effect.2-huerotate:huescale":"1.000000", + "D-effect.2-huerotate:satscale":"0.500000", "D-effect.2-kaleidoscope":"false", "D-effect.2-kaleidoscope:angles":"0.640000", "D-effect.2-kaleidoscope:inputrotation":"0.500000", @@ -648,11 +657,11 @@ "D-effect.2-mirror":"false", "D-effect.2-mirror:flipx":"0", "D-effect.2-mirror:flipy":"0", - "D-effect.2-mirror:in/out":"0.234000", + "D-effect.2-mirror:in/out":"1.000000", "D-effect.2-mirror:x":"0.500000", "D-effect.2-mirror:y":"0.500000", "D-effect.2-mirrorquad":"false", - "D-effect.2-mirrorquad:flipx":"1", + "D-effect.2-mirrorquad:flipx":"0", "D-effect.2-mirrorquad:flipy":"0", "D-effect.2-posterize":"false", "D-effect.2-posterize:posterize":"0.190000", @@ -666,6 +675,9 @@ "D-misc.generatevisual":"true", "D-misc.logic_sound":"true", "D-misc.logic_visual":"true", + "D-misc.looping_fade":"0.500000", + "D-misc.looping_length":"8", + "D-misc.looping_on":"false", "D-misc.midibehaviour":"default", "D-misc.midiinputpatch":"A", "D-misc.pitchfactor":"1.000000", @@ -692,9 +704,9 @@ "D-sound.chromatic":"false", "D-sound.controllerstyle":"modulationonly", "D-sound.midifile":"jsbach", - "D-sound.pitchmax":"72", - "D-sound.pitchmin":"25", - "D-sound.synth":"P_10_C_07", + "D-sound.pitchmax":"59", + "D-sound.pitchmin":"36", + "D-sound.synth":"P_07_C_10", "D-sound.velocitymax":"127", "D-sound.velocitymin":"45", "D-sound.xcontroller":"1", @@ -733,7 +745,7 @@ "D-visual.shape":"square", "D-visual.sizefinal":"0.900000", "D-visual.sizeinitial":"0.601000", - "D-visual.sizetime":"2.180000", + "D-visual.sizetime":"1.580000", "D-visual.smoothxyz":"3", "D-visual.speed":"0.210000", "D-visual.spritesource":"cursor", diff --git a/data_surge/config/paramenums.json b/data_surge/config/paramenums.json index 00561e84..52671393 100644 --- a/data_surge/config/paramenums.json +++ b/data_surge/config/paramenums.json @@ -3,7 +3,7 @@ "plugins": [ "", "quadpro" ], "guilevel": [ "0", "1", "2" ], "guiresize": [ "-800,0,800,1200", "100,100,800,1280", "" ], - "autostart": [ "gui,bidule,resolume", "bidule,resolume", "none" ], + "autostart": [ "gui", "none", "gui,bidule", "gui,resolume", "gui,bidule,resolume" ], "bidule": ["C:/Program Files/Plogue/Bidule/Bidule.exe", ""], "mmtt": ["kinect", "depthai", ""], "destination": [ ".", "A", "B", "C", "D" ], diff --git a/engine/cursor.go b/engine/cursor.go index e160502b..33cd3468 100644 --- a/engine/cursor.go +++ b/engine/cursor.go @@ -6,11 +6,15 @@ import ( "strings" "sync" "time" + + "github.com/hypebeast/go-osc/osc" ) // CursorDeviceCallbackFunc xxx type CursorCallbackFunc func(e CursorEvent) +var CursorClientPort = 6666 + // CursorEvent is a single Cursor event type CursorEvent struct { Cid string @@ -32,6 +36,8 @@ type CursorState struct { type CursorManager struct { cursors map[string]*CursorState + oscOutput bool + oscClient *osc.Client cursorsMutex sync.RWMutex } @@ -87,6 +93,19 @@ func (cm *CursorManager) GetCursorState(cid string) *CursorState { return cs } +func (cm *CursorManager) HandleCursorEvent(ce CursorEvent) { + + switch ce.Ddu { + + case "clear": + // Special event to clear cursors (by sending them "up" events) + cm.clearCursors() + + case "down", "drag", "up": + cm.handleDownDragUp(ce) + } +} + func (cm *CursorManager) clearCursors() { cm.cursorsMutex.RLock() @@ -111,19 +130,6 @@ func (cm *CursorManager) clearCursors() { cm.deleteCids(cidsToDelete) } -func (cm *CursorManager) HandleCursorEvent(ce CursorEvent) { - - switch ce.Ddu { - - case "clear": - // Special event to clear cursors (by sending them "up" events) - cm.clearCursors() - - case "down", "drag", "up": - cm.handleDownDragUp(ce) - } -} - func (cm *CursorManager) generateCursorGesture(cid string, noteDuration time.Duration, x0, y0, z0, x1, y1, z1 float32) { LogOfType("cursor", "generateCursorGesture start", "cid", cid, "noteDuration", noteDuration, "x0", x0, "y0", y0, "z0", z0, "x1", x1, "y1", y1, "z1", z1) @@ -184,6 +190,16 @@ func (cm *CursorManager) handleDownDragUp(ce CursorEvent) { // See who wants this cinput, but don't hold the Lock PluginsHandleCursorEvent(ce) + if cm.oscOutput { + if cm.oscClient == nil { + cm.oscClient = osc.NewClient(LocalAddress, CursorClientPort) + // oscClient is guaranteed to be non-nil + } + msg := CursorToOscMsg(ce) + err := cm.oscClient.Send(msg) + LogIfError(err) + LogOfType("cursor", "CursorManager sending to OSC client", "ce", ce) + } LogOfType("cursor", "CursorManager.handleDownDragUp", "ce", ce) @@ -195,6 +211,16 @@ func (cm *CursorManager) handleDownDragUp(ce CursorEvent) { } } +func CursorToOscMsg(ce CursorEvent) *osc.Message { + msg := osc.NewMessage("/cursor") + msg.Append(ce.Ddu) + msg.Append(ce.Cid) + msg.Append(float32(ce.X)) + msg.Append(float32(ce.Y)) + msg.Append(float32(ce.Z)) + return msg +} + func (cm *CursorManager) autoCursorUp(now time.Time) { // checkDelay is the number of CLicks that has to pass @@ -217,6 +243,8 @@ func (cm *CursorManager) autoCursorUp(now time.Time) { cm.cursorsMutex.RUnlock() cidsToDelete = append(cidsToDelete, cid) + + cidsToDelete = append(cidsToDelete, cid) } } cm.cursorsMutex.RUnlock() diff --git a/engine/engine.go b/engine/engine.go index 3eafa2f9..d3e4cca4 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -16,6 +16,7 @@ type Engine struct { params *ParamValues Router *Router Scheduler *Scheduler + CursorManager *CursorManager ProcessManager *ProcessManager // CursorManager *CursorManager done chan bool @@ -35,10 +36,15 @@ func NewEngine() *Engine { defer engineSysex.Unlock() InitLog("engine") + + cm := NewCursorManager() + router := NewRouter(cm) + TheEngine = &Engine{ params: NewParamValues(), - Router: NewRouter(), Scheduler: NewScheduler(), + Router: router, + CursorManager: cm, ProcessManager: NewProcessManager(), done: make(chan bool), } @@ -207,7 +213,7 @@ func (e *Engine) StartHTTP(port int) { default: response = ErrorResponse(fmt.Errorf("HTTP server unable to handle method=%s", req.Method)) } - }) +}) source := fmt.Sprintf("127.0.0.1:%d", port) err := http.ListenAndServe(source, nil) diff --git a/engine/engineapi.go b/engine/engineapi.go index 4719d5bb..5fb9d78e 100644 --- a/engine/engineapi.go +++ b/engine/engineapi.go @@ -248,15 +248,19 @@ func (e *Engine) SaveCurrent() (err error) { func (e *Engine) LoadCurrent() (err error) { path := SavedFilePath("engine", "_Current") paramsmap, err := LoadParamsMap(path) - e.params.ApplyValuesFromMap("engine", paramsmap) - debug := e.params.Get("engine.debug") - e.ResetLogTypes(debug) + if err == nil { + e.params.ApplyValuesFromMap("engine", paramsmap, e.Set) + } return err } func (e *Engine) Set(name string, value string) error { // LogInfo("Engine.Set", "name", name, "value", value) switch name { + case "engine.oscoutput": + b := IsTrueValue(value) + LogInfo("Changing oscoutput", "oscoutput", b) + e.Router.cursorManager.oscOutput = b case "engine.debug": e.ResetLogTypes(value) case "engine.attractidleminutes": diff --git a/engine/log.go b/engine/log.go index 902afd8b..caf9e006 100644 --- a/engine/log.go +++ b/engine/log.go @@ -91,6 +91,12 @@ func IsLogging(logtype string) bool { } +func LogIfError(err error, keysAndValues ...any) { + if err != nil { + LogError(err, keysAndValues...) + } +} + // LogError will accept a nil value and do nothing func LogError(err error, keysAndValues ...any) { diff --git a/engine/midi.go b/engine/midi.go index c834fe14..88060d45 100644 --- a/engine/midi.go +++ b/engine/midi.go @@ -195,8 +195,6 @@ func (state *MIDIPortChannelState) UpdateBankProgram(synth *Synth) { "data1", "0x"+hexString(data1)) LogError(state.output.Send([]byte{status, data1})) - } else { - // LogInfo("PROGRAM DID NOT CHANGE", "program", program, "mc.program", state.program) } } diff --git a/engine/params.go b/engine/params.go index 4732aefc..2a727439 100644 --- a/engine/params.go +++ b/engine/params.go @@ -107,7 +107,7 @@ func (vals *ParamValues) Set(name, value string) error { } // Currently, no errors are ever returned, but log messages are generated. -func (params *ParamValues) ApplyValuesFromMap(category string, paramsmap map[string]any) { +func (params *ParamValues) ApplyValuesFromMap(category string, paramsmap map[string]any, setfunc func(string, string) error) { for fullname, ival := range paramsmap { var value string @@ -131,7 +131,8 @@ func (params *ParamValues) ApplyValuesFromMap(category string, paramsmap map[str // Only include ones that match the category. // If the category is "patch", match any of sound/visual/effect/misc. if category == paramCategory || (category == "patch" && IsPerPatchParam(fullname)) { - err := params.Set(fullname, value) + // err := params.Set(fullname, value) + err := setfunc(fullname, value) if err != nil { LogError(err) // Don't abort the whole load, i.e. we are tolerant diff --git a/engine/patch.go b/engine/patch.go index 6fa78ff0..1dbff29d 100644 --- a/engine/patch.go +++ b/engine/patch.go @@ -460,7 +460,7 @@ func (patch *Patch) Load(category string, filename string) error { return err } } else { - patch.params.ApplyValuesFromMap(category, paramsmap) + patch.params.ApplyValuesFromMap(category, paramsmap, patch.params.Set) } // If there's a _override.json file, use it @@ -472,7 +472,7 @@ func (patch *Patch) Load(category string, filename string) error { if err != nil { return err } - patch.params.ApplyValuesFromMap(category, overridemap) + patch.params.ApplyValuesFromMap(category, overridemap, patch.params.Set) } // For any parameters that are in Paramdefs but are NOT in the loaded diff --git a/engine/player.go b/engine/player.go index 765358ba..c196a17c 100644 --- a/engine/player.go +++ b/engine/player.go @@ -1,27 +1,5 @@ package engine -/* -// HandleMIDIInput xxx -func (layer *Patch) HandleMidiEvent(me MidiEvent) { - LogInfo("Patch.HandleMidiEvent", "me", me) - for n, agent := range layer.agents { - ctx := layer.agentsContext[n] - agent.OnMidiEvent(ctx, me) - } - - layer.midiInputMutex.Lock() - defer layer.midiInputMutex.Unlock() - - LogOfType("midi", "Router.HandleMIDIInput", "event", e) - - if layer.MIDIThru { - layer.PassThruMIDI(e) - } - if layer.MIDISetScale { - layer.handleMIDISetScaleNote(e) - } -} - /* func CallerPackageAndFunc() (string, string) { pc, _, _, _ := runtime.Caller(1) @@ -60,41 +38,6 @@ func (layer *Patch) clearExternalScale() { /* */ -/* -func (layer) *Patch) cursorToPitch(ce CursorStepEvent) uint8 { - pitchmin := layer.params.ParamIntValue("sound.pitchmin") - pitchmax := layer.params.ParamIntValue("sound.pitchmax") - dp := pitchmax - pitchmin + 1 - p1 := int(ce.X * float32(dp)) - p := uint8(pitchmin + p1%dp) - chromatic := layer.params.ParamBoolValue("sound.chromatic") - if !chromatic { - scale := layer.getScale() - p = scale.ClosestTo(p) - // MIDIOctaveShift might be negative - i := int(p) + 12*layer.MIDIOctaveShift - for i < 0 { - i += 12 - } - for i > 127 { - i -= 12 - } - p = uint8(i + layer.TransposePitch) - } - return p -} -*/ - -/* - */ - -/* -func (layer) *Patch) cursorToDuration(ce CursorStepEvent) int { - return 92 -} - -*/ - /* func (layer) *Patch) loopQuant() { @@ -155,8 +98,4 @@ func (layer) *Patch) loopQuant() { } } } -*/ - -/* - - */ +*/ \ No newline at end of file diff --git a/engine/plugins.go b/engine/plugins.go index 85605f54..7e2af0e3 100644 --- a/engine/plugins.go +++ b/engine/plugins.go @@ -67,7 +67,7 @@ func PluginsHandleCursorEvent(ce CursorEvent) { for _, ctx := range Plugins { if ctx.IsSourceAllowed(source) { _, err := ctx.api(ctx, "event", ce.ToMap()) - LogError(err) + LogIfError(err) } } } diff --git a/engine/process.go b/engine/process.go index 6137407c..aee2840b 100644 --- a/engine/process.go +++ b/engine/process.go @@ -70,18 +70,19 @@ func (pm *ProcessManager) CheckAutostartProcesses() { func (pm *ProcessManager) Activate(process string) error { doall := (process == "all" || process == "*") - anydone := false + if !doall { + _, ok := pm.info[process] + if !ok { + return fmt.Errorf("ProcessManager.Activate: unknown process %s", process) + } + } for nm, pi := range pm.info { if (doall || nm == process) && pi.Activate != nil { LogOfType("process", "Activate", "process", nm) go pi.Activate() pi.Activated = true - anydone = true } } - if !anydone { - return fmt.Errorf("Activate: no process %s", process) - } return nil } @@ -101,6 +102,8 @@ func (pm *ProcessManager) AddProcessBuiltIn(process string) { pm.AddProcess(process, TheBidule().ProcessInfo()) case "resolume": pm.AddProcess(process, TheResolume().ProcessInfo()) + case "gui": + pm.AddProcess(process, GuiProcessInfo()) } } @@ -191,23 +194,44 @@ func (pm ProcessManager) KillAll(ctx *PluginContext) error { /* // KillProcess kills a process (synchronously) -func KillProcess(process string) { - switch process { - case "all": - for _, info := range ProcessInfo { - for _, info := range ProcssInfo { - KillExecuable(info.Exe) - cae "apps": - for nm, inf := rang ProcessInfo { - if IsAppName(nm) { - illExecutable(ino.Exe) - } - deault: - p, err = getProessInfo(process) - if err != nil { - illExecutablep.Exe) + func KillProcess(process string) { + switch process { + case "all": + for _, info := range ProcessInfo { + for _, info := range ProcssInfo { + KillExecuable(info.Exe) + cae "apps": + for nm, inf := rang ProcessInfo { + if IsAppName(nm) { + illExecutable(ino.Exe) + } + deault: + p, err = getProessInfo(process) + if err != nil { + illExecutablep.Exe) } */ + +func GuiProcessInfo() *ProcessInfo { + fullpath := EngineParam("gui") + if fullpath != "" && !FileExists(fullpath) { + LogWarn("No Resolume found, looking for", "path", fullpath) + return nil + } + if fullpath == "" { + fullpath = "C:\\Program Files\\Palette\\bin\\palette_gui.exe" + if !FileExists(fullpath) { + LogWarn("Gui not found in default location") + return nil + } + } + exe := fullpath + lastslash := strings.LastIndex(fullpath, "\\") + if lastslash > 0 { + exe = fullpath[lastslash+1:] + } + return NewProcessInfo(exe, fullpath, "", nil) +} diff --git a/engine/router.go b/engine/router.go index 8b663c70..16ef21c6 100644 --- a/engine/router.go +++ b/engine/router.go @@ -1,6 +1,7 @@ package engine import ( + "encoding/json" "fmt" "os" "strconv" @@ -56,11 +57,11 @@ type HeartbeatEvent struct { type APIExecutorFunc func(api string, nuid string, rawargs string) (result any, err error) -func NewRouter() *Router { +func NewRouter(cm *CursorManager) *Router { - r := Router{} - - r.cursorManager = NewCursorManager() + r := Router{ + cursorManager: cm, + } err := LoadParamEnums() if err != nil { @@ -261,14 +262,14 @@ func (r *Router) handleOSCInput(e OSCEvent) { case "/clientrestart": // This message currently comes from the FFGL plugins in Resolume - r.handleClientRestart(e.Msg) + r.oscHandleClientRestart(e.Msg) case "/event": // These messages encode the arguments as JSON LogError(fmt.Errorf("/event OSC message should no longer be used")) // r.handleOSCEvent(e.Msg) case "/button": - r.handleMMTTButton(e.Msg) + r.oscHandleButton(e.Msg) case "/cursor": // This message comes from the mmtt_kinect process, @@ -276,7 +277,16 @@ func (r *Router) handleOSCInput(e OSCEvent) { // cursor down/drag/up input. This is kinda like TUIO, // except that it's not a polling interface - servers // need to send explicit events, including a reliable "up". - r.handleMMTTCursor(e.Msg) + r.oscHandleCursor(e.Msg) + + /* + case "/sprite": + r.handleSpriteMsg(e.Msg) + */ + + case "/api": + err := r.oscHandleApi(e.Msg) + LogIfError(err) default: LogWarn("Router.HandleOSCInput: Unrecognized OSC message", "source", e.Source, "msg", e.Msg) @@ -293,7 +303,7 @@ func (r *Router) notifyGUI(eventName string) { LogOfType("osc", "Router.notifyGUI", "msg", msg) } -func (r *Router) handleMMTTButton(msg *osc.Message) { +func (r *Router) oscHandleButton(msg *osc.Message) { buttName, err := argAsString(msg, 0) if err != nil { LogError(err) @@ -303,7 +313,7 @@ func (r *Router) handleMMTTButton(msg *osc.Message) { go TheResolume().showText(text) } -func (r *Router) handleClientRestart(msg *osc.Message) { +func (r *Router) oscHandleClientRestart(msg *osc.Message) { nargs := msg.CountArguments() if nargs < 1 { @@ -320,8 +330,24 @@ func (r *Router) handleClientRestart(msg *osc.Message) { CallApiOnAllPlugins("event", map[string]string{"event": "clientrestart", "portnum": s}) } +func (r *Router) getXYZargs(msg *osc.Message) (x, y, z float32, err error) { + x, err = argAsFloat32(msg, 2) + if err != nil { + return + } + y, err = argAsFloat32(msg, 3) + if err != nil { + return + } + z, err = argAsFloat32(msg, 4) + if err != nil { + return + } + return +} + // handleMMTTCursor handles messages from MMTT, reformating them as a standard cursor event -func (r *Router) handleMMTTCursor(msg *osc.Message) { +func (r *Router) oscHandleCursor(msg *osc.Message) { nargs := msg.CountArguments() if nargs < 1 { @@ -338,22 +364,11 @@ func (r *Router) handleMMTTCursor(msg *osc.Message) { LogError(err) return } - x, err := argAsFloat32(msg, 2) - if err != nil { - LogError(err) - return - } - y, err := argAsFloat32(msg, 3) + x, y, z, err := r.getXYZargs(msg) if err != nil { LogError(err) return } - z, err := argAsFloat32(msg, 4) - if err != nil { - LogError(err) - return - } - ce := CursorEvent{ Cid: cid + ",mmtt", // NOTE: we add an mmmtt tag Click: CurrentClick(), @@ -380,6 +395,36 @@ func (r *Router) handleMMTTCursor(msg *osc.Message) { r.cursorManager.HandleCursorEvent(ce) } +/* +// handleSpriteMsg +func (r *Router) handleSpriteMsg(msg *osc.Message) { + x, y, z, err := r.getXYZargs(msg) + if err != nil { + LogError(err) + return + } + LogInfo("Router.handleSpriteMsg", "x", x, "y", y, "z", z) + // r.cursorManager.HandleCursorEvent(ce) +} +*/ + +// handleApiMsg +func (r *Router) oscHandleApi(msg *osc.Message) error { + apijson, err := argAsString(msg, 0) + if err != nil { + return err + } + var f any + err = json.Unmarshal([]byte(apijson), &f) + if err != nil { + return fmt.Errorf("unable to Unmarshal apijson=%s", apijson) + } + LogInfo("Router.handleApiMsg", "apijson", apijson) + LogInfo("Router.handleApiMsg", "f", f) + // r.cursorManager.HandleCursorEvent(ce) + return nil +} + /* func (r *Router) handleInputEventRaw(rawargs string) { @@ -409,6 +454,9 @@ func (r *Router) handleOSCEvent(msg *osc.Message) { */ func argAsInt(msg *osc.Message, index int) (i int, err error) { + if index >= len(msg.Arguments) { + return 0, fmt.Errorf("Not enough arguments, looking for index=%d", index) + } arg := msg.Arguments[index] switch v := arg.(type) { case int32: @@ -422,6 +470,9 @@ func argAsInt(msg *osc.Message, index int) (i int, err error) { } func argAsFloat32(msg *osc.Message, index int) (f float32, err error) { + if index >= len(msg.Arguments) { + return f, fmt.Errorf("Not enough arguments, looking for index=%d", index) + } arg := msg.Arguments[index] switch v := arg.(type) { case float32: @@ -435,6 +486,9 @@ func argAsFloat32(msg *osc.Message, index int) (f float32, err error) { } func argAsString(msg *osc.Message, index int) (s string, err error) { + if index >= len(msg.Arguments) { + return s, fmt.Errorf("Not enough arguments, looking for index=%d", index) + } arg := msg.Arguments[index] switch v := arg.(type) { case string: diff --git a/engine/synth.go b/engine/synth.go index 2fce3a7c..a0531b22 100644 --- a/engine/synth.go +++ b/engine/synth.go @@ -21,6 +21,7 @@ type Synth struct { // midiChannelOut *MidiChannelOutput noteDown []bool noteDownCount []int + state *MIDIPortChannelState } var Synths map[string]*Synth @@ -93,14 +94,14 @@ func NewSynth(name string, port string, channel int, bank int, program int) *Syn portchannel := PortChannel{port: port, channel: channel} - var midiChannelOut *MIDIPortChannelState + var state *MIDIPortChannelState if name == "fake" { - midiChannelOut = MIDI.openFakeChannelOutput(port, channel) + state = MIDI.openFakeChannelOutput(port, channel) } else { - midiChannelOut = MIDI.openChannelOutput(portchannel) + state = MIDI.openChannelOutput(portchannel) } - if midiChannelOut == nil { + if state == nil { LogWarn("InitSynths: Unable to open", "port", port) return nil } @@ -112,6 +113,7 @@ func NewSynth(name string, port string, channel int, bank int, program int) *Syn // midiChannelOut: midiChannelOut, noteDown: make([]bool, 128), noteDownCount: make([]int, 128), + state: state, } sp.ClearNoteDowns() // debugging, shouldn't be needed return sp @@ -123,7 +125,7 @@ func (synth *Synth) updatePortChannelState() (*MIDIPortChannelState, error) { return nil, err } // This only sends the bank and/or program if they change - state.UpdateBankProgram(synth) + synth.UpdateBankProgram() return state, nil } @@ -392,3 +394,36 @@ func (synth *Synth) SendNoteToMidiOutput(value any) { LogWarn("output.Send", "err", err) } } + +func (synth *Synth) SendBytes(bytes []byte) error { + return synth.state.output.Send(bytes) +} + +func (synth *Synth) UpdateBankProgram() { + + state := synth.state + synth.state.mutex.Lock() + defer synth.state.mutex.Unlock() + + // LogInfo("Checking Bank Program", "bank", bank, "program", program, "mc.bank", state.bank, "mc.program", state.program, "mc", fmt.Sprintf("%p", state)) + if state.bank != synth.bank { + LogWarn("SendBankProgram: XXX - SHOULD be sending", "bank", synth.bank) + state.bank = synth.bank + } + // if the requested program doesn't match the current one, send it + if state.program != synth.program { + // LogInfo("PROGRAM CHANGED", "program", program, "mc.program", state.program) + state.program = synth.program + status := byte(int64(ProgramStatus) | int64(state.channel-1)) + data1 := byte(synth.program - 1) + LogInfo("SendBankProgram: MIDI", "status", hexString(status), "program", hexString(data1)) + LogOfType("midi", "Raw MIDI Output, BankProgram", + "synth", synth.name, + "status", "0x"+hexString(status), + "data1", "0x"+hexString(data1)) + + LogError(state.output.Send([]byte{status, data1})) + } else { + // LogInfo("PROGRAM DID NOT CHANGE", "program", program, "mc.program", state.program) + } +} diff --git a/plugin/logic.go b/plugin/logic.go index 86f0c0f1..b01a58a3 100644 --- a/plugin/logic.go +++ b/plugin/logic.go @@ -4,7 +4,6 @@ import ( "math" "sync" - "github.com/hypebeast/go-osc/osc" "github.com/vizicist/palette/engine" ) @@ -117,12 +116,7 @@ func (logic *PatchLogic) cursorToVelocity(ctx *engine.PluginContext, ce engine.C func (logic *PatchLogic) generateVisualsFromCursor(ce engine.CursorEvent) { // send an OSC message to Resolume - msg := osc.NewMessage("/cursor") - msg.Append(ce.Ddu) - msg.Append(ce.Cid) - msg.Append(float32(ce.X)) - msg.Append(float32(ce.Y)) - msg.Append(float32(ce.Z)) + msg := engine.CursorToOscMsg(ce) engine.TheResolume().ToFreeFramePlugin(logic.patch.Name(), msg) } diff --git a/python/palette.py b/python/palette.py index c25a9043..21c45003 100644 --- a/python/palette.py +++ b/python/palette.py @@ -26,44 +26,45 @@ PerformDefaultVal = {} # these values are indexes into PerformLabels -PerformLabels["loopinglength"] = [ - {"label":"Loop Length_8 beats", "value":8*OneBeat}, - {"label":"Loop Length_16 beats", "value":16*OneBeat}, - {"label":"Loop Length_32 beats", "value":32*OneBeat}, - {"label":"Loop Length_64 beats", "value":64*OneBeat}, - {"label":"Loop Length_4 beats", "value":4*OneBeat}, -] -SimpleScales = [ - {"label":"*Newage_Scale", "value":"newage"}, - {"label":"*Arabian_Scale", "value":"arabian"}, - # {"label":"*Chromatic_Scale", "value":"chromatic"}, - # {"label":"*Dorian_Scale","value":"dorian"}, - {"label":"*Fifths_Scale", "value":"fifths"}, - {"label":"*Harminor_Scale", "value":"harminor"}, - # {"label":"*Lydian_Scale","value":"lydian"}, - {"label":"*Melminor_Scale", "value":"melminor"}, - {"label":"*Raga_Scale", "value":"raga1"}, -] -PerformScales = [ - {"label":"*Newage_Scale", "value":"newage"}, - # {"label":"*Aeolian_Scale", "value":"aeolian"}, - {"label":"*Arabian_Scale", "value":"arabian"}, - {"label":"*Chromatic_Scale", "value":"chromatic"}, - # {"label":"*Dorian_Scale","value":"dorian"}, - {"label":"*Fifths_Scale", "value":"fifths"}, - {"label":"*Harminor_Scale", "value":"harminor"}, - # {"label":"*Ionian_Scale","value":"ionian"}, - # {"label":"*Locrian_Scale", "value":"locrian"}, - # {"label":"*Lydian_Scale","value":"lydian"}, - {"label":"*Melminor_Scale", "value":"melminor"}, - # {"label":"*Mixolydian_Scale","value":"mixolydian"}, - {"label":"*Phrygian_Scale", "value":"phrygian"}, - {"label":"*Raga_Scale", "value":"raga1"}, - # {"label":"*Raga2_Scale", "value":"raga2"}, - # {"label":"*Raga3_Scale", "value":"raga3"}, - # {"label":"*Raga4_Scale", "value":"raga4"}, -] -PerformDefaultVal["scale"] = 0 +#PerformLabels["loopinglength"] = [ +# {"label":"Loop Length_8 beats", "value":8*OneBeat}, +# {"label":"Loop Length_16 beats", "value":16*OneBeat}, +# {"label":"Loop Length_32 beats", "value":32*OneBeat}, +# {"label":"Loop Length_64 beats", "value":64*OneBeat}, +# {"label":"Loop Length_4 beats", "value":4*OneBeat}, +#] + +# SimpleScales = [ +# {"label":"*Newage_Scale", "value":"newage"}, +# {"label":"*Arabian_Scale", "value":"arabian"}, +# # {"label":"*Chromatic_Scale", "value":"chromatic"}, +# # {"label":"*Dorian_Scale","value":"dorian"}, +# {"label":"*Fifths_Scale", "value":"fifths"}, +# {"label":"*Harminor_Scale", "value":"harminor"}, +# # {"label":"*Lydian_Scale","value":"lydian"}, +# {"label":"*Melminor_Scale", "value":"melminor"}, +# {"label":"*Raga_Scale", "value":"raga1"}, +# ] +# PerformScales = [ +# {"label":"*Newage_Scale", "value":"newage"}, +# # {"label":"*Aeolian_Scale", "value":"aeolian"}, +# {"label":"*Arabian_Scale", "value":"arabian"}, +# {"label":"*Chromatic_Scale", "value":"chromatic"}, +# # {"label":"*Dorian_Scale","value":"dorian"}, +# {"label":"*Fifths_Scale", "value":"fifths"}, +# {"label":"*Harminor_Scale", "value":"harminor"}, +# # {"label":"*Ionian_Scale","value":"ionian"}, +# # {"label":"*Locrian_Scale", "value":"locrian"}, +# # {"label":"*Lydian_Scale","value":"lydian"}, +# {"label":"*Melminor_Scale", "value":"melminor"}, +# # {"label":"*Mixolydian_Scale","value":"mixolydian"}, +# {"label":"*Phrygian_Scale", "value":"phrygian"}, +# {"label":"*Raga_Scale", "value":"raga1"}, +# # {"label":"*Raga2_Scale", "value":"raga2"}, +# # {"label":"*Raga3_Scale", "value":"raga3"}, +# # {"label":"*Raga4_Scale", "value":"raga4"}, +#] +#PerformDefaultVal["scale"] = 0 PerformLabels["quantstyle"] = [ {"label":"Fret_Quantize", "value":"frets"}, @@ -76,17 +77,17 @@ {"label":"Fixed_Vol", "value":"fixed"}, ] -PerformLabels["loopingfade"] = [ - {"label":"Loop Fade_Slowest", "value":0.7}, - {"label":"Loop Fade_Slower", "value":0.6}, - {"label":"Loop Fade_Slow", "value":0.5}, - {"label":"Loop Fade_Med", "value":0.4}, - {"label":"Loop Fade_Fast", "value":0.2}, - {"label":"Loop Fade_Faster", "value":0.1}, - {"label":"Loop Fade_Fastest", "value":0.05}, - {"label":"Loop_Forever", "value":1.0}, -] -PerformDefaultVal["loopingfade"] = 7 +#PerformLabels["loopingfade"] = [ +# {"label":"Loop Fade_Slowest", "value":0.7}, +# {"label":"Loop Fade_Slower", "value":0.6}, +# {"label":"Loop Fade_Slow", "value":0.5}, +# {"label":"Loop Fade_Med", "value":0.4}, +# {"label":"Loop Fade_Fast", "value":0.2}, +# {"label":"Loop Fade_Faster", "value":0.1}, +# {"label":"Loop Fade_Fastest", "value":0.05}, +# {"label":"Loop_Forever", "value":1.0}, +#] +#PerformDefaultVal["loopingfade"] = 7 PerformLabels["deltaztrig"] = [ {"label":"Retrigger_Pressure OFF", "value":1.0}, @@ -100,12 +101,12 @@ ] PerformDefaultVal["deltaytrig"] = 0 -PerformLabels["loopingonoff"] = [ - {"label":"Looping_is OFF", "value":"off"}, - # {"label":"Looping_is ON", "value":"recplay"}, - {"label":"Looping_is ON", "value":"recplay"}, - {"label":"Loop_Playback Only", "value":"play"}, -] +#PerformLabels["loopingonoff"] = [ +# {"label":"Looping_is OFF", "value":"off"}, +# # {"label":"Looping_is ON", "value":"recplay"}, +# {"label":"Looping_is ON", "value":"recplay"}, +# {"label":"Loop_Playback Only", "value":"play"}, +#] PerformLabels["midithru"] = [ {"label":"MIDI Thru_On", "value":True}, diff --git a/python/palette_gui.py b/python/palette_gui.py index 509a1c56..4aba4138 100644 --- a/python/palette_gui.py +++ b/python/palette_gui.py @@ -83,6 +83,7 @@ def __init__(self, self.nextMode = "" self.lastLoadType = "" self.lastLoadName = "" + self.processRunning = {"bidule":False,"resolume":False} self.defaultGuiLevel = int(os.environ.get("PALETTE_GUI_LEVEL","0")) @@ -197,12 +198,12 @@ def __init__(self, self.initLayout() self.resetAll() - def setScaleList(self): - if self.guiLevel == 0: - palette.GlobalPerformLabels["scale"] = palette.SimpleScales - else: - palette.GlobalPerformLabels["scale"] = palette.PerformScales - self.globalPerformIndex["scale"] = palette.PerformDefaultVal["scale"] +# def setScaleList(self): +# if self.guiLevel == 0: +# palette.GlobalPerformLabels["scale"] = palette.SimpleScales +# else: +# palette.GlobalPerformLabels["scale"] = palette.PerformScales +# self.globalPerformIndex["scale"] = palette.PerformDefaultVal["scale"] def placePatchChooser(self): if self.guiLevel > 0: @@ -904,8 +905,8 @@ def sendGlobalPerformVal(self,name): palette.palette_engine_api("set_tempo_factor", "\"value\": \""+str(val) + "\"") elif name == "transpose": palette.palette_engine_api("set_transpose", "\"value\": \""+str(val) + "\"") - elif name == "scale": - palette.palette_engine_api("set_scale", "\"value\": \""+str(val) + "\"") +# elif name == "scale": +# palette.palette_engine_api("set_scale", "\"value\": \""+str(val) + "\"") elif name == "transposeauto": palette.palette_engine_api("set_transposeauto", "\"onoff\": \""+str(val) + "\"") @@ -944,7 +945,7 @@ def cycleGuiLevel(self): def setGuiLevel(self,level): self.guiLevel = level - self.setScaleList() +# self.setScaleList() def sendANO(self): for patch in self.Patches: @@ -954,6 +955,24 @@ def startHelp(self): log("startHelp: nextMode = help") self.nextMode = "help" + def startstopProcess(self,processName): + log("starstopProcess "+processName) + if self.processRunning[processName]: + api = "stopprocess" + else: + api = "startprocess" + log("Calling api="+api+" process="+processName) + palette.palette_quadpro_api(api,"\"process\": \"" + processName + "\"") + self.processRunning[processName] = not self.processRunning[processName] + + def startstopBidule(self): + log("starstop Bidule") + self.startstopProcess("bidule") + + def startstopResolume(self): + log("starstop Resolume") + self.startstopProcess("resolume") + def resetAll(self): # log("ResetAll") @@ -1248,32 +1267,32 @@ def sendPerformVal(self,name): index = self.performIndex[name] labels = palette.PerformLabels[name] val = labels[index]["value"] - if name == "loopingonoff": - reconoff = False - playonoff = False - if val == "off": - pass - elif val == "recplay": - reconoff = True - playonoff = True - elif val == "play": - reconoff = False - playonoff = True - else: - log("Unrecognized value of loopingonoff - %s" % val) - return - - palette.palette_patch_api(self.name(), "loop_recording", '"onoff": "'+str(reconoff)+'"') - palette.palette_patch_api(self.name(), "loop_playing", '"onoff": "'+str(playonoff)+'"') - - elif name == "loopinglength": - palette.palette_patch_api(self.name(), "loop_length", '"value": "'+str(val)+'"') - elif name == "loopingfade": - palette.palette_patch_api(self.name(), "loop_fade", '"fade": "'+str(val)+'"') - elif name == "loopingset": - palette.palette_patch_api(self.name(), "loop_set", '"set": "'+str(val)+'"') - elif name == "midithru": + if name == "midithru": palette.palette_patch_api(self.name(), "midi_thru", "\"onoff\": \"" + str(val) + "\"") +# elif name == "loopingonoff": +# reconoff = False +# playonoff = False +# if val == "off": +# pass +# elif val == "recplay": +# reconoff = True +# playonoff = True +# elif val == "play": +# reconoff = False +# playonoff = True +# else: +# log("Unrecognized value of loopingonoff - %s" % val) +# return +# +# palette.palette_patch_api(self.name(), "loop_recording", '"onoff": "'+str(reconoff)+'"') +# palette.palette_patch_api(self.name(), "loop_playing", '"onoff": "'+str(playonoff)+'"') +# +# elif name == "loopinglength": +# palette.palette_patch_api(self.name(), "loop_length", '"value": "'+str(val)+'"') +# elif name == "loopingfade": +# palette.palette_patch_api(self.name(), "loop_fade", '"fade": "'+str(val)+'"') +# elif name == "loopingset": +# palette.palette_patch_api(self.name(), "loop_set", '"set": "'+str(val)+'"') elif name == "midisetscale": palette.palette_patch_api(self.name(), "midi_setscale", "\"onoff\": \"" + str(val) + "\"") elif name == "midiquantized": @@ -1288,8 +1307,8 @@ def sendPerformVal(self,name): elif name == "quantstyle": palette.palette_patch_set(self.name(), "misc.quantstyle",val) - elif name == "scale": - palette.palette_patch_set(self.name(), "misc.scale",val) +# elif name == "scale": +# palette.palette_patch_set(self.name(), "misc.scale",val) elif name == "volstyle": palette.palette_patch_set(self.name(), "misc.volstyle",val) @@ -1500,7 +1519,7 @@ def __init__(self, parent, controller, pagename, params): # On the "quad" editing page, the parameter values aren't shown, # just the buttons to import/export/save - if pagename != "quad": + if pagename != "quad" and pagename != "patch": self.paramsFrame.pack(side=tk.LEFT, pady=0) self.scrollbar.pack(side=tk.LEFT, fill=tk.Y, expand=True, pady=10, padx=5) self.updateParamView() @@ -1584,7 +1603,7 @@ def makeButtonArea(self): self.exportButton.bind("", lambda event:self.saveExportRelease()) self.exportButton.pack(side=tk.LEFT, padx=2) - b = ttk.Label(f, text="Save", style='RandEtcButton.TLabel') + b = ttk.Label(f, text="Save As", style='RandEtcButton.TLabel') b.bind("", lambda event:self.saveCallback()) b.pack(side=tk.LEFT, pady=5, padx=2) @@ -2120,12 +2139,14 @@ def __init__(self, parent, controller): self.makePerformButton("Reset_All", self.controller.resetAll) self.makePerformButton("Clear_ ", self.controller.clear) self.makePerformButton("Help_ ", self.controller.startHelp) + self.makePerformButton("Start/Stop_Bidule", self.controller.startstopBidule) + self.makePerformButton("Start/Stop_Resolume", self.controller.startstopResolume) # More advanced buttons - self.makePerformButtonAdvanced("loopingonoff",None) - self.makePerformButtonAdvanced("loopingfade",None) - self.makePerformButtonAdvanced("loopinglength",None) - self.makePerformButtonAdvanced("scale",None) +# self.makePerformButtonAdvanced("loopingonoff",None) +# self.makePerformButtonAdvanced("loopingfade",None) +# self.makePerformButtonAdvanced("loopinglength",None) +# self.makePerformButtonAdvanced("scale",None) self.makePerformButtonAdvanced("transpose",None) self.makePerformButtonAdvanced("transposeauto",None) self.makePerformButtonAdvanced("Notes_Off", self.controller.sendANO) diff --git a/scripts/killallpalette.bat b/scripts/killall.bat similarity index 100% rename from scripts/killallpalette.bat rename to scripts/killall.bat