Whats wronf ..pdef

I copied something from the web to get acquinted with pdefs
For some reason when executing the temp clock, all I hear is a faint zooming in the background , the instrument plays fine when executed separately .
The Synthdef output assignement is different because the person was using soundflower to record it.
The code shown in the screensho was enough to get the pdef running ,except mine :slight_smile:
1
Edit , changed some syntax erros , but still no luck

(
SynthDef(\hat,
{
   	 |amp,atk,dec|
   	var sig;
   	sig=WhiteNoise.ar();
   	sig=HPF.ar(sig,6000);
   	sig=sig*EnvGen.ar(Env.perc(atk,dec),doneAction:Done.freeSelf);
   	sig=sig*amp!2;
   	Out.ar(0,sig)
}).add;
)
///
Synth(\hat,[\amp,0.1,\atk,0.001,\dec,0.111]);
~clock=TempoClock(90.0 / 60.0).permanent_(true);
(
Pdef(\hats,Pbind(
   \instrument, \hat,
   \amp,0.1,
   \atk,0.001,
   \dec,0.1,
   \dur,0.25
));
)

Pdef(\hats).play(~clock);

I have another issue , here in the pbind control when I lower the octave ( see comment line ) , the volume decreases a lot
Overall volume is also pretty silent .


(
SynthDef(\mads,
{
   	 |amp=1,atk=0.001,dec=0.2,freq=444|
   	var sig;
   	sig=LFTri.ar(freq);
   	sig=HPF.ar(sig,6000);
   	sig=sig*EnvGen.ar(Env.perc(atk,dec),doneAction:2);
   	sig=sig*amp!2;
   	Out.ar(0,sig)
}).add;
)
//
Synth(\mads,[\amp,1,\atk,0.001,\dec,0.111,\freq,440]);
//////

(
Pdef(\mads,
	Pbind(
		\instrument,\mads,
		\amp,1,
		\dur ,0.25,
		\degree,0,
		\octave,3,///significantly lowers volume??
		\pan,0
	)
).play;
)

It’s more obvious in this pattern , notice how the last highest note is alot louder


(
SynthDef(\mads,
{
   	 |amp=1,atk=0.001,dec=0.2,freq=444|
   	var sig;
   	sig=LFTri.ar(freq);
   	sig=HPF.ar(sig,6000);
   	sig=sig*EnvGen.ar(Env.perc(atk,dec),doneAction:2);
   	sig=sig*amp!2;
   	Out.ar(0,sig)
}).add;
)
//
Synth(\mads,[\amp,1,\atk,0.001,\dec,0.111,\freq,440]);
//////

(
Pdef(\mads,
	Pbind(
		\instrument,\mads,
		\amp,1,
		\dur ,0.12,
		\degree,Pseq([0,4,5,7,9,12,15,17,26],inf),
		\octave,3,///significantly lowers volume??
		\pan,0
	)
).play;
)
 

the whole signal goes thru a high pass filter at 6000 Hz in this synth, so lower notes are mostly filtered out.

Nice catch , totally forgot about that