‘store’ is needed for the NRT part of the example and is generally ok with patterns, not only in this case,
from the help: “Write the defFile and store it in the SynthDescLib specified by libname”.
So duration as extra arg is passed correctly:
SynthDef(\diracs, { |out = 0, duration = 60, amp = 0.1|
OffsetOut.ar(out, [Impulse.ar(10), DC.ar(0)] *
EnvGen.ar(Env([amp, amp, 0], [duration + 0.01, 0]), doneAction: 2))
}).store;
p = Pbind(\instrument, \diracs, \duration, 0.5, \dur, Pn(1, 1), \amp, 0.3).play