giuliomoro i've been struggling with a small roadblock. in some quick examples i built to sonify the OSC messages being pumped into SC im met with crashes and ERROR: OSC messages must have type tags.
i suspect it is the lack of defining the integers we are sending from the main.cpp into SC?
also do you think this is a suitable way to edit the main.cpp parse to send floats or should i be more focused on how they are being recieved in SC?
here is my WIP .cpp for adding to the main cpp for floats
} else if (msg.match("/purple").popFloat(value1).isOkNoMoreArgs())
{
printf("received /purple float %f\n", value1);
and here is the light example im running to sonify in SC.
//open port
thisProcess.openUDPPort(5555);
//define control
(
OSCdef.new(\knob0, {
arg msg, time, addr, port;
x.set(\freq, msg[1].linexp(0,1,20,500));
}, '/encoder', nil, 5555, [0], );
);
(
OSCdef.new(\knob1, {
arg msg, time, addr, port;
x.set(\pan, msg[1].linlin(0,1,-1,1));
}, '/encoder', nil, 5555, [1], );
);
(
OSCdef.new(\knob2, {
arg msg, time, addr, port;
x.set(\amp, msg[1].linexp(0.1,0.01,1));
}, '/encoder', 5555, [2], );
);
(
OSCdef.new(\knob3, {
arg msg, time, addr, port;
x.set(\nharm, msg[1].linlin(0,1,1,50));
}, '/encoder', nil, 5555, [3], );
);
(
OSCdef.new(\knob4, {
arg msg, time, addr, port;
x.set(\detune, msg[1].linexp(0,1,0.01,12));
}, '/encoder', \detune, 5555, [4], );
)
//compile synthdef
(
SynthDef.new(\example, {
arg freq=40, nharm=12, detune=0.2, gate=0,
pan=0, amp=1, out=0;
var sig, env;
env = EnvGen.kr(Env.adsr(0.05,0.1,0.5,3),gate);
sig = Blip.ar (
freq *
LFNoise1.kr(0.2!16).bipolar(detune.neg,detune).midiratio,
nharm
);
sig = sig * LFNoise1.kr(0.5!16).exprange(0.1,1);
sig = Splay.ar(sig);
sig = Balance2.ar(sig[0], sig[1], pan);
sig = sig * env * amp;
Out.ar(out, sig);
}).add
)
// open gate
x = Synth.new(\example, [\gate, 1]);