Closed jildertviet closed 1 year ago
Tested: ofxUDPManager is bi-directional. I thought it wasn't, perhaps it has changed. To do: get OSC dump from SC when setting up a remote server.
Try ofxOscBidrectional Edit: works. It receives OSC send with SendReply.kr (SC)
Initial idea for mapping SC UGens to ofxJVisuals Events:
Create Event in SC.
Create a modulating synth on the server.
Object.createMod()
--> Create a Bus and a Synth that sends OSC w/ SendReply.
{SendReply.kr(Impulse.kr(30), '/cmdName', [parameterID, In.kr(this.bus)], this.id)}.play
How to know which parameter to map?
Something like: Object.createMod("brightness", [0, 255]); // Name + range
Give a map to each UGen, "brightness" -> 0, "speed" -> 1, etc
Then modulate with:
x = {var dest = Object.bus("brightness"); Out.kr(dest.bus, LFPulse.kr(1).range(dest.range))}.play;
2022 update. The add-on starts an own SC server. (I think the previous example works with the default server of sclang). New goal is to have the server run on the same machine as OF.
How would mapping go?
Example to show current implementation
~of = Server.remote(\of, NetAddr("localhost", 9999));
(
j = JRectangle.new();
j.create();
j.startBundle; // Make sure they're send at the same time
j.setLoc([100, 800]);
j.setSize([100, 100]);
j.setFilled(false);
j.endBundle;
j.mod("width", {SinOsc.kr(1).range(100, 200)});
)
Multiple versions of the code above resulted in:
Is it possible to add a UDP socket that sets up a SC client?
If so, then SendReply.kr might be nice to map oscillators to values of Events.