Pbindef fade in and fade out

Hi,

I really like the way I can create fadein (from silence) and fadeout (to complete silence) effect when playing with ProxySpace.
I’m used to do that the following way

p=ProxySpace.push(s.boot);
~test = Pbind(\instrument,\default,\dur,1,\amp,1, \midinote, 60);
~test.play(fadeTime:5);
~test.stop(fadeTime:10);

I would like to create the same effect using Pbindefs. Is it possible?
I’ve tried something like that but it seems not to work the same way.

Pbindef(\test,\instrument,\default,\dur,1,\amp,1,\midinote, 60);
Pbindef(\test).play(fadeTime:2);
Pbindef(\test).stop(fadeTime:10);

I think there’s something wrong with my comprehension of the thing.
How to obtain a similar effect with Pbindef? Is there some chances it could work with Pdef maybe?

Thank you very much for your support and, by the way, merry Christmas to you all!

1 Like

I think its not possible - The NodeProxy version is controlling the volume of a node that the Pbind is playing on - Pbindef is just changing a pbind’s keys (discretely)… Pbinds can’t vary parameters smoothly though you can kind of spoof that (there a nice help file on Patterns and LFOs somewhere).

You can recreate the effect you’re used to outside a Proxy Space with a NodeProxy or Ndef. Or explicitly set the output bus of your Pbind and control it with a Synth… (someone else here may have a cleverer idea!)

2 Likes
p=ProxySpace.push(s.boot);
~test = Pbindef(\x,\instrument,\default,\dur,1,\amp,1,\midinote, 60);
~test.play(fadeTime:5);
~test.stop(fadeTime:10);

See also this recent thread

As @semiquaver has mentioned it, the tutorial ‘Event Patterns and LFOs’ is contained in miSCellaneous_lib

You could e.g. gradually mute a Pbindef by replacing its amp stream

Pbindef(\x,
	\midinote, Pwhite(60, 90),
	\dur, 0.2,
	\amp, 0.1 
).play
	
Pbindef(\x, \amp, Pseg(Pseq([0.1, Pn(0)]), 10))

Pbindef(\x, \amp, Pseg(Pseq([0, Pn(0.1)]), 10))

I’d love to be able to control continuous parameter changes via pattern - at the very least for Pmono - there are ways of doing this with Lag etc but I haven’t found anything that isn’t cumbersome… since events have durations it seems like there should be a way,

I’d do this with Pbind of type set, then you can take all benefits of Pbindef. E.g.:

Pdef.removeAll

// start silently first
x = Synth(\default, [amp: 0]);

Pbindef(\a,
	\type, \set,
	\id, x.nodeID,
	\midinote, Pshuf((60..90), inf),
	\dur, 0.2,
	\amp, 0.1,
	\pan, 0
).play

// helper function for fading with Pseg

~f = { |start, end, time, curve = 0| Pseg(Pseq([start, Pn(end)], time, curve)) }

Pbindef(\a, \amp, ~f.(0.1, 0.5, 10))

Pbindef(\a, \pan, ~f.(0, -1, 5))

Pbindef(\a, \pan, ~f.(-1, 1, 5))


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

With PLbindef from miSCellaneous_lib:

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

PLbindef(\b,
	\type, \set,
	\id, x.nodeID,
	\midinote, Pshuf((60..90), inf),
	\dur, 0.2,
	\amp, 0.1,
	\pan, 0
).play


~b.amp = ~f.(0.1, 0.5, 10)

~b.pan = ~f.(0, -1, 5)

~b.pan = ~f.(-1, 1, 5)


~b.stop;
x.release;

Note that for non-standard args you’d have to define the setting option within Pbind / Pbindef:

	\args, [\bla_1, \bla_2],

Durations / tempo fading wouldn’t work in the same way, see this thread for some suggestions on this special case:

Oops, bracket error, should be:

~f = { |start, end, time, curve = 0| Pseg(Pseq([start, Pn(end)]), time, curve) }

Additional good news is that with the correct version durs can be set in the same way !

1 Like