Understanding Note Duration in PmonoArtic

I’m confused about how exactly the parameters of PmonoArtic affect note duration. There is tempo, dur, delta, legato, and sustain. Given these, how do I calculate the time between two notes in the pattern?

A contrived example:

~artic_example = {
	var def = SynthDef.new(\example, { arg out, pitch, gate = 1, delta, dur, tempo, legato, sustain;
		var signal = SinOsc.ar(pitch) * EnvGen.ar(Env.adsr(), gate: gate);
		Out.ar(out, signal.dup);
		DetectSilence.ar(signal, doneAction: Done.freeSelf);
	}).add;
	
	server.sync;
	
	PmonoArtic(def.name, *[
		pitch: Pseq(440 * [1, 2, 2.5, 1.5]),
		delta: 0.25,
		dur: 1.4,
		tempo: 2,
		sustain: 1.2,
		legato: 0.15
	]).play;
};

You would never specify all of these parameters at the same time, I did here just to try to understand how they interact.

With note duration, I mean the time between pitch first changing, and the envelope starting to release.

If I want to time for example a Line sweep to have the exact duration of a note in this pattern, or any PmonoArtic specifying only a subset of the above parameters, could someone spell out how to compute that time? I think delta has priority over everything, dur is always 1 / tempo, but I’m unsure if that is even true, how legato and sustain interact with these, and if there is more parameters that affect note duration.

Thank you

delta is the difference in beats between one onset and the next.

it is computed by dur * stretch (which defaults to 1)

sustain is how long the note lasts - if dur is 1 and sustain is 2 the first note will overlap with the second. sustain is dur * stretch * legato (default legato is 0.8).

if you specify sustain and delta you can skip dur and legato! (delta will override dur for example, although dur will still be present for computation purposes)

so… dur * stretch (or delta) / tempo should give you the time between onsets IIRC!!

1 Like