rsc3/doc-schelp/HelpSource/Classes/Pgroup.schelp

33 lines
893 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
class:: Pgroup
summary:: Starts a new Group and plays the pattern in this group
related:: Classes/Group, Classes/Pbus
categories:: Streams-Patterns-Events>Patterns>Server Control
description::
The group is released when the stream has ended. The group's strong::release:: is delayed (default 0.1 beats) until after the last note releases. But, Pgroup does not know how long the synths' envelopes last. You can extend the lag by putting the number of beats into the event prototype's code::\groupReleaseTime:: key:
code::
Pgroup(...).play(protoEvent: Event.default.put(\groupReleaseTime, releaseLag));
::
Examples::
code::
p = Pbind(\degree, Prand((0..7), inf), \dur, 0.3, \legato, 0.2);
// watch the node structure as it changes
s.waitForBoot({ s.plotTree });
// one group
Pgroup(p).play;
// two nested groups
Pgroup(Pgroup(p)).play;
Pgroup(Ppar([Pgroup(p), Pgroup(p)])).play;
::