How to implement a Pmonodef?

I’m looking to have the ease of a Pbindef with a Pmono meaning starting the Pmono and being able to modify some of its parameters while running:

Pmonodef(\fxp, \delay,
	\damp, Pseq([-24,-12,-6,-3,0].mirror,inf).trace,
	\dur, 4
).play;
Pmonodef(\fxp, \dur, 2);

How to implement this ? I was about to build a Pmonodef myself, but… I don’t feel comfortable enough yet.

The closest I’ve got now is:

(
~fx=Synth(\delay, target:~effectGrp);
~fxp=Pmono(\delay,\id, ~fx.nodeID,
	\damp, Pseq([-24,-12,-6,-3,0].mirror,inf).trace,	
	\dur,4
).play;
)
~fxp.stop;
// restart with new parameters
~fxp=Pmono(\delay,\id, ~fx.nodeID,
	\damp, Pseq([-24,-12,-6,-3,0].mirror,1).trace,	
	\dur,2
).play;

Any better approach ?

One of my favorite tricks is that you can convert almost any event pattern into Pmono or PmonoArtic by chaining (“pattern composition”). The “trick” about it is that you only need Pmono to be the last thing touching the events. The data inside the events can come from anywhere – another pattern. Most of the examples about Pmono might lead you to the conclusion that data to be played monophonically must be generated within Pmono – not true.

I hadn’t tried it before with Pbindef, but it actually works!

s.boot;

Pbindef(\x, \degree, Pn(Pseries(0, 1, 8), inf), \dur, 0.25);

Pdef(\y, Pmono(\default, \dummy, 0) <> Pbindef(\x)).play;

Pbindef(\x, \degree, Pn(Pseries(-7, 2, 8), inf));

Pdef(\y).stop;

hjh

1 Like

You can also use the event type ‘set’

// start Synth silently

x = Synth(\default, [amp: 0])

// start Pbindef

(
Pbindef(\x,
	\type, \set,
	\id, x.nodeID,
	\args, #[freq, amp],
	\midinote, Pseq((60..65).mirror1, inf),
	\amp, 0.1,
	\dur, 0.2
).play;
)

Pbindef(\x, \dur, Pseq([2, 1, 1] / 10, inf))

(
Pbindef(\x).stop;
x.release
)



// with PLbindef from miSCellaneous_lib quark

x = Synth(\default, [amp: 0])

(
Pdef.removeAll;

PLbindef(\x,
	\type, \set,
	\id, x.nodeID,
	\args, #[freq, amp],
	\midinote, PLseq((60..65).mirror1),
	\amp, 0.1,
	\dur, 0.2
).play;
)

~x.dur = PLseq([2, 1, 1] / 10)

(
~x.stop;
x.release
)

Nice one.
Although still not really concise and “self-speaking”. Is there a reason for the lack of Pmonodef in SC ? Does it worth being added as RFC ?

Because nobody has written the class yet.

There may be reasons why nobody has done it – maybe because there’s not a high demand, maybe because the available approach is not extremely inconvenient. Often useful features get added just because someone wants them.

Perhaps consider modeling it after PmonoArtic rather than Pmono, to avoid a future question “Why is there Pmonodef and not PmonoArticdef?” :laughing: – if the new class sets a default \legato > 1 then the default behavior would be like Pmono.

hjh

I will l try that…