Pattern note off gate happening sooner than expected

SynthDef.new(\test, {
	|out, freq, gate = 1|
	Out.ar(out, 0.1 * SinOsc.ar(freq) * Linen.kr(gate, releaseTime: 0, doneAction: 0));
}).add;

Pbind(\instrument, \test, \dur, Pseq([32])).play;
Pbind(\instrument, \test, \dur, Pseq([1], 32), \freq, 880).play;

At the default 60bpm tempo, I would expect the first Pbind to play a 440hz sine wave for 32 seconds. Instead, it stops after 26 seconds.

This is particularly obvious if playing the two Pbinds together: the first one with the 440hz held note stops several seconds before the second one, which plays 880hz short notes every second.

I must be misunderstanding how patterns send note off events, any explanation would be much appreciated.

Hi and welcome,

it’s the default legato value of 0.8 – this has already fooled many people (and, btw, the default amp of 0.1 is still fooling me occasionally). See the Event helpfile,

Greetings

Daniel

1 Like

Lifesaver!

Looks like defaultParentEvent is a private member, is there a way I can set legato to 1 by default for all my patterns or do I need to specify it everywhere?

I think you can do this:

Event.addParentType(\note, (legato:1));
1 Like