PHSusePlayer (PHelpSynthUsePlayer) player object for PHSuse and PHSparUse
Part of: miSCellaneous
Inherits from: Object
Implicitely instantiated when PHSuse's or PHSparUse's play method is called.
See also: Working with HS and HSpar, HS with VarGui, PHSuse, PHSparUse
Some Important Issues
Creation / Class Methods
*new (pHelpSynthUse)
Creates a new PHSusePlayer object.
phelpSynthUse - A PHSuse or PHSparUse object.
Status control
play(clock, quant, quantBufferTime)
clock - A TempoClock object. If not assigned, takes the default TempoClock.
quant - Quant or SimpleNumber. Makes the player start at the next grid that gives enough time for latency.
quantBufferTime - SimpleNumber (seconds). Calculated time to include latency for "stepping in"
is lengthened by this value. Defaults to 0.2.
stop(addAction)
addAction - Function to be evaluated at receive time.
pause(addAction)
= stop
free
Only free this PHSusePlayer - the PHSplayer / PHSparPlayer, which is using the same HS / HSpar, is not affected.
Note: stop (= pause) allows resuming the player - free resets, player can be started again.
Examples
(
s = Server.local;
Server.default = s;
s.boot;
)
// define HS, PHS, PHSuse
(
h = HS(s, { |freq = 0.5, dev = 10, center = 65| LFDNoise3.kr(freq, dev, center) });
u = PHS(h, nil, // default help synth args
// two pbinds with different timing
Prand([0.4, 0.2],inf) , [ \midinote, Pkey(\val) + 4, \amp, 0.07 ],
0.1, [ \midinote, Pkey(\val) + 15 + Pxrand([0, 2, 5],inf), \amp, 0.04, \legato, 0.5 ]
);
v = PHSuse(h, // two pbinds with different timing
Prand([0.4, 0.2],inf) , [ \midinote, Pkey(\val), \amp, 0.07 ],
0.1, [ \midinote, Pkey(\val) + 6 + Pxrand([0, 2, 5],inf), \amp, 0.06, \legato, 0.5 ]
);
c = TempoClock(1);
q = 0.2;
)
// play PHS
x = u.play(c,q);
// play PHSuse
y = v.play(c,q);
// stop PHSplayer
x.stop;
// PHSusePlayer doesn't control HS - HS synth still running, see server window
y.free;
// PHSplayer controls HS - this also stops HS synth
x.free;