# Dseries but with glissando?

Hello

Newb here, I am sure there is different ways to approach this:
I would like to keep the speed/reset/incrementation principles of Dseries while make it behaving like an Env (no jumps between each incrementations but glissandos)

``````Demand.kr(Impulse.kr(1), Impulse.kr(0.2), Dseries(1, 1, 9));

``````

Meaning in this case: gliding from 1 to 2, from 2 to 3, 3 to 4 and so on. The important thing for my patch is to keep both the speed and reset trigs as a sequencing master.

Secondly, what would be the equivalent on the language side using Pseries?

Thanks a lot!

Use “Demand.kr(…).lag(0.5)”
This will smooth all the changes in th Demand.kr by 0.5 sec.

You can do the same with the Patterns at the level of your SynthDef arguments.

If you define your SynthDef arguments as “var freq=\freq.kr(440,0.5)” your Freq argument will be initialized at 440 and a lag of 0.5

1 Like

Thanks____

This question is not easy to answer, or maybe, the easiest answer would be that actually there is none, but let’s put it in this way: If you just regard the sequence of events (without lagging), clearly, Dseries is the exact equivalent of Pseries.

``````(
SynthDef(\test_demand, { |out = 0, amp = 0.1|
// there's no Dn equivalent to Pn, so take Dseq here
var freq = Demand.ar(Impulse.ar(5), 0, Dseq([Dseries(60, 2, 3)], inf));
Out.ar(out, Saw.ar(freq.midicps, amp)!2)
)

x = Synth(\test_demand)

x.free

(
SynthDef(\test_pat, { |out = 0, freq = 440, amp = 0.1|
Out.ar(out, Saw.ar(freq, amp)!2)
)

(
x = Pmono(\test_pat,
\dur, 0.2,
\midinote, Pn(Pseries(60, 2, 3))
).play
)

x.stop
``````

But as soon as you are lagging the freq inside \test_demand you’re in the audio domain, which is not directly accessible to patterns. However, the underlying sequencing can still be done with them.

``````(
SynthDef(\test_demand_lagged, { |out = 0, amp = 0.1|
var freq = Demand.ar(Impulse.ar(5), 0, Dseq([Dseries(60, 2, 3)], inf)).lag(0.1);
Out.ar(out, Saw.ar(freq.midicps, amp)!2)
)

x = Synth(\test_demand_lagged)

x.free

// BTW, an alternative would be varlag, which allows to define the lag curvature.

(
SynthDef(\test_pat_lagged, { |out = 0, freq = 440, amp = 0.1|
Out.ar(out, Saw.ar(freq.lag(0.1), amp)!2)
)

// a bit different at start as Demand starts from 0

(
x = Pmono(\test_pat_lagged,
\dur, 0.2,
\midinote, Pn(Pseries(60, 2, 3))
).play
)

x.stop
``````

Then there’s Pseg, which basically is a dynamic Env, but here you can only do a “quasi-glissando”

``````(
x = Pmono(\test_pat,
\dur, 0.2,
\midinote, Pseg(Pseq([60, 64], inf), Pseq([3, 0], inf))
).play
)
``````

It’s important to distinguish the different concepts of glissando and “quasi glissando”. It depends on the use case what would fit best.

The resetting brings in another very subtle point as resetting can be done immediately, in relation to a grid, also server- and language-side, etc.

In general, if your focus is on differentiated sequencing, Patterns might be better suited as there are more possibilities to tweak them. Also demand rate ugens somtimes show unclear behaviour at init time:

``````{
Demand.ar(
Impulse.ar(100),
Impulse.ar(20),
Dseries(0, 1, 9)
).lag(0.01)
}.plot(0.2)

// maybe you wouldn't expect that

{
Demand.ar(
Impulse.ar(100),
Impulse.ar(20),
Dseries(1, 1, 9)
).lag(0.01)
}.plot(0.2)
``````

Having said that, DemandEnvGen might also be worth considering.

1 Like