fadeTime with Pdef and Pbindef

This question describes an understandable demand, but there is a tricky background involving two blocks of questions.

  1. What do you actually (technically) expect ?
    Should the values of the Pbind-generated synths be changed from event to event, should this happen ‘totally’ gradually in the sense that amp is mapped to a bus so that amp is diminished for every event? Depending on the answer different solutions would be possible. As you have been involved, I mention this related thread for others:
    Continuous Panning of Multiple Pbind Nodes?

  2. How to deal with the question in combination with Pdef / Pbindef
    It could be that fading Pdefs doesn’t do what you expect.
    See this example:

     (
     Pdef.removeAll;
    
     Pdef(\y, Pbind(
     	\instrument, \default,
     	\dur, 0.5,
     	\amp, 0.5,
     	\out, 0,
     )).play;
    
     Pdef(\y).fadeTime = 5;
     )
    
     // do fade, a second player is added !
     Pbindef(\y, \freq, 700);
    

So when “fading out the amp” we are crossfading chords of same pitches where one has amp 0 !
I’m not a JITLib expert but I am not aware if generating a Pdef and then treating it as Pbindef for fading (though possible as they share the same namespace) is an intended usage. There are no fading examples in Pbindef help !

The fading examples I see in the help refer to Pdef sources, so you could do this:

(
Pdef.removeAll;

Pdef(\y, Pbind(
	\instrument, \default,
	\dur, 0.5,
	\amp, 0.5,
	\out, 0,
)).play;

Pdef(\y).fadeTime = 5;
)


Pdef(\y).source = Pbind(
	\instrument, \default,
	\dur, 0.5,
	\amp, 0,
	\out, 0,
) 

Pdef(\y).source = Pbind(
	\instrument, \default,
	\dur, 0.5,
	\amp, 0.5,
	\out, 0,
) 


Pdef(\y).source = Pbind(
	\instrument, \default,
	\dur, 0.35,
	\midinote, 62,
	\amp, 0.5,
	\out, 0,
) 

Pdef(\y).stop

You can save writing here by using template patterns and Pchain. Concerning Pbindef Julian could tell better, so maybe ask him directly or on the mailing list.

2 Likes