PHSplayer (PHelpSynthPlayer) PHS player object
Part of: miSCellaneous
Inherits from: PHSusePlayer (PHelpSynthUsePlayer)
Implicitely instantiated when PHS's play method is called, allows stopping and resuming with options also concerning the help synth.
See also: Working with HS and HSpar, HS with VarGui, HS, PHS, PHSuse, PHSusePlayer
Some Important Issues
Creation / Class Methods
*new (pHelpSynth)
Creates a new PHSplayer object.
pHelpSynth - A PHS object.
Status control
play(clock, quant, hsPlay, pbindPlay, 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.
hsPlay - Boolean. Determines if help synth should also start. Defaults to true.
pbindPlay - Boolean. Determines if Pbind(s) should play. Defaults to true.
quantBufferTime - SimpleNumber (seconds). Calculated time to include latency for "stepping in"
is lengthened by this value. Defaults to 0.2.
stop(hsStop, pbindStop, addAction)
hsStop - Boolean. Determines if help synth should stop. Defaults to false.
pbindStop - Boolean. Determines if Pbind player(s) should stop. Defaults to true.
addAction - Function to be evaluated at receive time.
pause(hsStop, pbindStop, addAction)
= stop
free
Stop the PHSplayer and all PHSusePlayers that are using the same HS, also free the HS.
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 - play
(
h = HS(s, { |freq = 0.5, dev = 10, center = 65| LFDNoise3.kr(freq, dev, center) });
p = PHS(h, nil, // default help synth args
Prand([0.4, 0.2],inf), [ \midinote, Pkey(\val), \amp, 0.1 ],
0.1, [ \midinote, Pkey(\val) + 9.5 + Pxrand([0, 2, 5],inf), \amp, 0.08 ]
).play;
)
// stop only help synth
p.stop(hsStop: true, pbindStop: false);
// stop pbind
p.stop;
// resume help synth and eventstream player
p.play(hsPlay: true, pbindPlay: true);
// stop player and free HS
p.free;