Grouping synths with touch osc?

Hi everyone, I am a beginner at sc and touch osc and I would be grateful if someone have time and drop a thought for a solution to my problem.
Something is going wrong grouping the Synths. So, when I do the connection with touch osc I can’t control an arg in the group. Both Synths play separately but not together in the group g, so I can’t control with the fader5 the common amp.
Any ideas?

s.boot;

OSCFunc.trace(true);

(
OSCdef(\fader5,{ // water + traveller
arg msg, time, addr, port;
msg[1].postln;
g.set(\amp, msg[1]);
}, ‘/1/fader5’, recvPort: 57120);
)

~revBus = Bus.audio(s,1);

(
SynthDef(\reverb,{
var sig;
sig = In.ar(~revBus,1);
sig = FreeVerb.ar(sig);
sig = Out.ar(0,sig);
}).add;
)

(
SynthDef(\traveller, {
arg freq, amp = 0.5, atk, rls, rate, dis;
var sig,env;
env = Env.perc(atk,rls);
env = EnvGen.kr(env, doneAction:2);
dis = SinOsc.ar((freq * ({Rand(0.8, 2.3)}!30)) + (dis * {Rand(0.0, 1.2)}!30));
sig = SinOsc.ar(freq + LFNoise0.kr(8).range(-200,400));
sig = sig * env * amp;
Out.ar(~revBus, sig);
}).add;
)

Synth(\reverb);
t = Synth(\traveller, [\freq, 400, \amp, 0.5, \atk, 5, \rls, 45, \rate, 1]);

Buffer.freeAll;
~b1 = Buffer.read(s, “/Users/Polina/Desktop/SOUND EFFECTS/Stream.wav”);
~b1.play;

(
SynthDef(\simpleSynth, {
arg freq, amp=1, buf, loop = 1, rate = 1;
var sig;
sig = PlayBuf.ar(2, buf, rate, loop:loop, doneAction:2);
sig = sig * amp;
sig = Out.ar(0, sig);
}).add;
)

g = Group.new; ///water + traveller

t = Synth(\traveller, [\freq, rrand(100,2000), \amp, 0.5, \atk, 2, \rls, 35, \rate, 1, g]);
w = Synth(\simpleSynth, [\amp, 0.5, \rate, 1, \buf,~b1.bufnum, g]);
g.set(\amp);
///water + traveller
(
w = Synth(\simpleSynth, [\amp, 0.5, \rate, 1, \buf,~b1.bufnum, g]);
t = Synth(\traveller, [\freq, 400, \amp, 0.5, \atk, 2, \rls, 35, \rate, 2, g]);
)
g.set(\amp);

Hi!

First, please use backticks to enclose code:

```
Your code here
```

Second:

The “g” at the end isn’t the right way to assign a group. Check the documentation for Synth.new and look at the target argument.

hjh

thanks jamshark, where can I find this documentation?

In the help browser of the IDE or online at http://doc.sccode.org/Classes/Synth.html

thanks catniptwinz! :slight_smile: