Spot the syntax error

I am copying a synthdef frome eli’s tutorial ( right upon the pbind ) but get an unmatched parenthesis error somewhere after the bandpas filter code
I checked and double ,triple checked but can’t seem to find the error

(
SynthDef (\bpfsaw,   {
	arg atk=2, sus=0, rel=3, c1=1, c2=(-1),
	freq=500, detune=0.2, pan=0, cfhzmin=0.1,  cfhzmax=0.3,
	cfmin=500, cfmax=2000, rqmin=0.1, rqmax=0.2,
	lsf=200, ldb=0, amp=1, out=0;
	var sig, env;
	env = EnvGEn.kr(Env([0,1,1,0],[atk,sus,rel],[c1,0,c2]),doneAction:2);
	sig= BPF.ar(
			sig,
			{LFNoise1.kr (
				LFNoise1.kr(4).exprange(cfhzmin,cfhzmax)
			).exprange(cfmin, cfmax)!2,
			{LFNoise1.kr(0.1).exprange(rqmin, rqmax)}!2
			) ;
			sig=BLowshelf.ar(sig, lsf, 0.5,ldb);
			sig=Balance2.ar(sig[0], sig[1],pan);
			sig= sig*env*amp;
		Out.ar(out, sig);
}).add;
)

BPF.ar is missing a closing parenthesis. If you hover over a parenthesis, it will show the matching one, or show a red selection if there’s an error. So for the next time you know how to figure it out on your own.

Yep I found it shortly after I posted ,
Seems that I forgot a whole line of code , focus focus focus :slight_smile:

It’s here. You have an opening { but there should be a closing } before the ! dup operator.

I would indent it like this to make it clearer. In general, if you’re in the habit of opening multiple levels of brackets on one line (e.g. { some stuff( line break more stuff ) }, this makes it harder to read the brackets. A rule of thumb is, if the bracketed area will span multiple lines, open the bracket only at the end of the line and nowhere else, and the corresponding closing bracket should appear only at the start of a line.

{
    LFNoise1.kr(
        LFNoise1.kr(4).exprange(cfhzmin,cfhzmax)
    ).exprange(cfmin, cfmax)
} ! 2,

hjh

Now I got everything right ( no console errors ) , still it misses the obvious filtering effectfrom the video

(
SynthDef(\bpfsaw,  {
	arg atk=2, sus=0, rel=3, c1=1, c2=(-1),
	freq=500, detune=0.2, pan=0, cfhzmin=0.1,  cfhzmax=0.3,
	cfmin=500, cfmax=2000, rqmin=0.1, rqmax=0.2,
	lsf=200, ldb=0, amp=1, out=0;
	var sig, env;
	env = EnvGen.kr(Env([0,1,1,0],[atk,sus,rel],[c1,0,c2]),doneAction:2);
	sig=Saw.ar(freq* {LFNoise1.kr(0.5,detune).midiratio}!2);
	sig= BPF.ar(
			sig,
			{LFNoise1.kr (
				LFNoise1.kr(4).exprange(cfhzmin,cfhzmax)
		).exprange(cfmin, cfmax)}!2,
			{LFNoise1.kr(0.1).exprange(rqmin, rqmax)}!2
			) ;
			sig=BLowShelf.ar(sig, lsf, 0.5,ldb);
			sig=Balance2.ar(sig[0], sig[1],pan);
			sig= sig*env*amp;
		Out.ar(out, sig);
}).add;
)


(
Pbind(
	\instr, \bpfsaw,
	\dur , 2,
	\midinote,  Pseq([54,61,56],1),
	\detune, 0.08,
	\cfmin, 100,
	\cfmax, 1500,
	\atk, 1,
	\ldb, 6,
	\amp,0.2,
	\out, 0,
).play;
)

Starts at 21:53

\instrument instead of \instr. Pbind(\instr...) shouldn’t be found in any helpfiles or tutorials; I have no idea where that came from.

s.dumpOSC(1);

(
Pbind(
	\instr, \bpfsaw,
	\dur , 2,
	\midinote,  Pseq([54,61,56],1),
	\detune, 0.08,
	\cfmin, 100,
	\cfmax, 1500,
	\atk, 1,
	\ldb, 6,
	\amp,0.2,
	\out, 0,
).play;
)

[ "#bundle", 16357461283999032570, 
  [ 9, "default", 1003, 0, 1, "out", 0, "freq", 185.077, "amp", 0.2, "pan", 0 ]
]

"default" means that it isn’t playing the bpfsaw synthdef at all.

(
Pbind(
	\instrument, \bpfsaw,
	\dur, 2,
	\midinote, Pseq([54,61,56],1),
	\detune, 0.08,
	\cfmin, 100,
	\cfmax, 1500,
	\atk, 1,
	\ldb, 6,
	\amp, 0.2,
	\out, 0,
).play;
)

[ "#bundle", 16357461683594713495, 
  [ 9, "bpfsaw", 1006, 0, 1, "atk", 1, "freq", 185.077, "detune", 0.08, "pan", 0, "cfmin", 100, "cfmax", 1500, "ldb", 6, "amp", 0.2, "out", 0 ]
]

s.dumpOSC(0);

hjh