Here are ~~three~~ four different approaches you can try out to see if they are close to what you are looking for.

(added a fourth approach)

#1

```
// NodeProxy mono synth
(
Ndef(\monosynth, {
var freq = \freq.kr(220);
var trig = \trig.tr(1);
var sig = Saw.ar(freq);
var aeg = Env.perc(0.01, 0.2).ar(gate:trig);
var ffreq = \cutoff.kr(2000) * aeg;
var res = \res.kr(0.5).linlin(0, 1, 1, 0.01);
sig = RLPF.ar(sig, ffreq, res);
sig = sig * aeg;
Splay.ar(sig);
})
)
Ndef(\monosynth)[10] = \set -> Pbind(\degree, Pseq([0, 1, 2, 3], inf), \dur, 0.25, \trig, 1)
Ndef(\monosynth).play
Ndef(\monosynth).stop
Ndef(\monosynth).set(\cutoff, 1000)
Ndef(\monosynth).set(\cutoff, 4000)
Ndef(\monosynth).set(\res, 0)
Ndef(\monosynth).set(\res, 0.5)
Ndef(\monosynth).set(\res, 0.7)
```

#2

```
(
SynthDef(\synth, {
var freq = \freq.kr(220);
var gate = \gate.kr(1);
var sig = Saw.ar(freq);
var aeg = Env.perc(0.01, 0.2).ar(gate:gate, doneAction:Done.freeSelf);
var ffreq = \cutoff.kr(2000) * aeg;
var res = \res.kr(0.5).linlin(0, 1, 1, 0.01);
sig = RLPF.ar(sig, ffreq, res);
sig = sig * aeg;
sig = Splay.ar(sig);
Out.ar(\out.kr(0), sig);
}).add
)
// control buses
Ndef(\cutoff, {\val.kr(1000)})
Ndef(\res, {\val.kr(0.5)})
// pattern
(
Pdef(\synth, Pbind(
\instrument, \synth,
\degree, Pseq([0, 1, 2, 3], inf),
\dur, 0.25,
\legato, 0.1,
\cutoff, Ndef(\cutoff),
\res, Ndef(\res)
))
)
Pdef(\synth).play
Pdef(\synth).stop
// instead of controling the synth per se
// you are controling the buses used by the synth
Ndef(\cutoff).set(\val, 1000)
Ndef(\cutoff).set(\val, 4000)
Ndef(\res).set(\val, 0)
Ndef(\res).set(\val, 0.5)
```

#3

```
(
SynthDef(\monosynth, {
var freq = \freq.kr(220);
var trig = \trig.tr(1);
var sig = Saw.ar(freq);
var aeg = Env.perc(0.01, 0.2).ar(gate:trig);
var ffreq = \cutoff.kr(2000) * aeg;
var res = \res.kr(0.5).linlin(0, 1, 1, 0.01);
sig = RLPF.ar(sig, ffreq, res);
sig = sig * aeg;
sig = Splay.ar(sig);
Out.ar(\out.kr(0), sig);
}).add
)
~mono = Synth(\monosynth, [\trig, 0])
(
Pdef(\mono, Pbind(
\type, \set,
\id, Pfunc({ ~mono.nodeID }),
\args, #[\freq, \trig],
\degree, Pseq([0, 1, 2, 3], inf),
\dur, 0.25,
\trig, 1
))
)
Pdef(\mono).play
Pdef(\mono).stop
~mono.set(\cutoff, 1000)
~mono.set(\cutoff, 4000)
~mono.set(\res, 0)
~mono.set(\res, 0.5)
~mono.set(\res, 0.7)
```

#4

```
(
SynthDef(\monosynth, {
var freq = \freq.kr(220);
var trig = \trig.tr(1);
var sig = Saw.ar(freq);
var aeg = Env.perc(0.01, 0.2).ar(gate:trig);
var ffreq = \cutoff.kr(2000) * aeg;
var res = \res.kr(0.5).linlin(0, 1, 1, 0.01);
sig = RLPF.ar(sig, ffreq, res);
sig = sig * aeg;
sig = Splay.ar(sig);
Out.ar(\out.kr(0), sig);
}).add
)
(
Pdef(\mono,
Pfset({
~id = Synth(\monosynth, [\trig, 0]);
// add a reference to the top environment
// so the synth can be manipulated
topEnvironment[\mono] = ~id
},
Pbind(
\type, \set,
\args, #[\freq, \trig],
\degree, Pseq([0, 1, 2, 3], inf),
\dur, 0.25,
\trig, 1
))
)
)
Pdef(\mono).play
Pdef(\mono).stop
~mono.set(\cutoff, 1000)
~mono.set(\cutoff, 4000)
~mono.set(\res, 0)
~mono.set(\res, 0.5)
~mono.set(\res, 0.7)
```

You can also use Pdef set method to access synth parameters outside of a Pbind

```
(
SynthDef(\synth, {
var freq = \freq.kr(220);
var trig = \gate.kr(1);
var sig = Saw.ar(freq);
var aeg = Env.perc(0.01, 0.2).ar(gate:trig, doneAction:Done.freeSelf);
var ffreq = \cutoff.kr(2000) * aeg;
var res = \res.kr(0.5).linlin(0, 1, 1, 0.01);
sig = RLPF.ar(sig, ffreq, res);
sig = sig * aeg;
sig = Splay.ar(sig);
Out.ar(\out.kr(0), sig);
}).add
)
(
Pdef(\synth,
Pbind(
\instrument, \synth,
\degree, Pseq([0, 1, 2, 3], inf),
\dur, 0.25,
\legato, 0.1
))
)
)
Pdef(\synth).play
Pdef(\synth).stop
Pdef(\synth).set(\cutoff, 1000)
Pdef(\synth).set(\res, 0)
Pdef(\synth).gui
Pdef(\synth).set(\cutoff, 4000)
Pdef(\synth).set(\res, 0.5)
Pdef(\synth).set(\res, 0.7)
```