|
@@ -5,6 +5,9 @@
|
|
|
// Clear any existing OSC definitions
|
|
// Clear any existing OSC definitions
|
|
|
OSCdef.freeAll;
|
|
OSCdef.freeAll;
|
|
|
|
|
|
|
|
|
|
+// Create network connextion for Processing forwarding
|
|
|
|
|
+~targetIP = NetAddr.new("127.0.0.1", 57122);
|
|
|
|
|
+
|
|
|
// Variables to track current pen type and color
|
|
// Variables to track current pen type and color
|
|
|
~currentPenType = "\pen";
|
|
~currentPenType = "\pen";
|
|
|
~currentColor = (r: 0.0, g: 0.0, b: 1.0); // Default blue
|
|
~currentColor = (r: 0.0, g: 0.0, b: 1.0); // Default blue
|
|
@@ -162,6 +165,9 @@ OSCdef.freeAll;
|
|
|
OSCdef(\xOSC, { |msg, time, addr, port|
|
|
OSCdef(\xOSC, { |msg, time, addr, port|
|
|
|
var x = msg[1].asFloat;
|
|
var x = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
// Update current pad value and change effects
|
|
// Update current pad value and change effects
|
|
|
~currentPadValues.x = x;
|
|
~currentPadValues.x = x;
|
|
|
~changeEffectParams.value;
|
|
~changeEffectParams.value;
|
|
@@ -172,6 +178,9 @@ OSCdef(\xOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\yOSC, { |msg, time, addr, port|
|
|
OSCdef(\yOSC, { |msg, time, addr, port|
|
|
|
var y = msg[1].asFloat;
|
|
var y = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
// Update current pad value and change effects
|
|
// Update current pad value and change effects
|
|
|
~currentPadValues.y = y;
|
|
~currentPadValues.y = y;
|
|
|
~changeEffectParams.value;
|
|
~changeEffectParams.value;
|
|
@@ -182,6 +191,9 @@ OSCdef(\yOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\pressureOSC, { |msg, time, addr, port|
|
|
OSCdef(\pressureOSC, { |msg, time, addr, port|
|
|
|
var pressure = msg[1].asFloat;
|
|
var pressure = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
// Update current pad value and change effects
|
|
// Update current pad value and change effects
|
|
|
~currentPadValues.pressure = pressure;
|
|
~currentPadValues.pressure = pressure;
|
|
|
~changeEffectParams.value;
|
|
~changeEffectParams.value;
|
|
@@ -196,6 +208,9 @@ OSCdef(\pressureOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\penOSC, { |msg, time, addr, port|
|
|
OSCdef(\penOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -207,6 +222,9 @@ OSCdef(\penOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\monolineOSC, { |msg, time, addr, port|
|
|
OSCdef(\monolineOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -218,6 +236,9 @@ OSCdef(\monolineOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\markerOSC, { |msg, time, addr, port|
|
|
OSCdef(\markerOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -229,6 +250,9 @@ OSCdef(\markerOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\pencilOSC, { |msg, time, addr, port|
|
|
OSCdef(\pencilOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -240,6 +264,9 @@ OSCdef(\pencilOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\crayonOSC, { |msg, time, addr, port|
|
|
OSCdef(\crayonOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -251,6 +278,9 @@ OSCdef(\crayonOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\fountainPenOSC, { |msg, time, addr, port|
|
|
OSCdef(\fountainPenOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -262,6 +292,9 @@ OSCdef(\fountainPenOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\waterColorOSC, { |msg, time, addr, port|
|
|
OSCdef(\waterColorOSC, { |msg, time, addr, port|
|
|
|
var penType = msg[1].asFloat;
|
|
var penType = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
if (penType == 1.0) {
|
|
if (penType == 1.0) {
|
|
|
~currentPenType = msg[0].asString;
|
|
~currentPenType = msg[0].asString;
|
|
|
["Current pen type:", ~currentPenType].postln;
|
|
["Current pen type:", ~currentPenType].postln;
|
|
@@ -277,6 +310,9 @@ OSCdef(\opacityOSC, { |msg, time, addr, port|
|
|
|
var a = msg[1].asFloat;
|
|
var a = msg[1].asFloat;
|
|
|
~currentPadValues.a = a;
|
|
~currentPadValues.a = a;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
}, '/a');
|
|
}, '/a');
|
|
|
|
|
|
|
|
|
|
|
|
@@ -285,6 +321,9 @@ OSCdef(\opacityOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\redOSC, { |msg, time, addr, port|
|
|
OSCdef(\redOSC, { |msg, time, addr, port|
|
|
|
var component = msg[1].asFloat;
|
|
var component = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
// Update current color
|
|
// Update current color
|
|
|
~currentColor.r = component;
|
|
~currentColor.r = component;
|
|
|
~setSynthsParam.(\redAmt, component);
|
|
~setSynthsParam.(\redAmt, component);
|
|
@@ -296,6 +335,9 @@ OSCdef(\redOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\greenOSC, { |msg, time, addr, port|
|
|
OSCdef(\greenOSC, { |msg, time, addr, port|
|
|
|
var component = msg[1].asFloat;
|
|
var component = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
// Update current color
|
|
// Update current color
|
|
|
~currentColor.g = component;
|
|
~currentColor.g = component;
|
|
|
~setSynthsParam.(\greenAmt, component);
|
|
~setSynthsParam.(\greenAmt, component);
|
|
@@ -307,6 +349,9 @@ OSCdef(\greenOSC, { |msg, time, addr, port|
|
|
|
OSCdef(\blueOSC, { |msg, time, addr, port|
|
|
OSCdef(\blueOSC, { |msg, time, addr, port|
|
|
|
var component = msg[1].asFloat;
|
|
var component = msg[1].asFloat;
|
|
|
|
|
|
|
|
|
|
+ // Forward for Processing
|
|
|
|
|
+ ~targetIP.sendMsg(msg[0].asString, msg[1].asFloat);
|
|
|
|
|
+
|
|
|
// Update current color
|
|
// Update current color
|
|
|
~currentColor.b = component;
|
|
~currentColor.b = component;
|
|
|
~setSynthsParam.(\blueAmt, component);
|
|
~setSynthsParam.(\blueAmt, component);
|
|
@@ -318,6 +363,7 @@ OSCdef(\blueOSC, { |msg, time, addr, port|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// Start the OSC server on port 57120 (default SuperCollider port)
|
|
// Start the OSC server on port 57120 (default SuperCollider port)
|
|
|
thisProcess.openUDPPort(57120);
|
|
thisProcess.openUDPPort(57120);
|
|
|
"OSC server ready on port 57120".postln;
|
|
"OSC server ready on port 57120".postln;
|