Forgot a help fix: Drag a dock's title bar, not divider, to reposition
[supercollider.git] / HelpSource / Classes / Pgate.schelp
blob3f515289526a47c87364f77c3e1988eae2e1c4ae
1 class:: Pgate
2 summary:: gated stream advances only when an event key is true
3 related:: Classes/Pn
4 categories:: Streams-Patterns-Events>Patterns>Repetition
6 description::
8 Pgate advances its subpattern whenever strong::key:: is true. Pgate must be used within an Event pattern.
10 Examples::
12 code::
13 // Pn advances Pgate each time its subpattern is repeated
15 Pbind(
17         \degree,        Pn(Pseq((0..7)), inf, \step),
18         \mtranspose,    Pgate(Pwhite(0,5), inf, \step),
19         \dur, 0.2
20 ).play
24 // Two different Pgates advanced at two different rates
26 Pbind(
28         \scale,         Scale.minor,
30         \foo,           Pn(Pseq((0..2)),inf,  \step1),
31         \degree,        Pn(Pseq((0..7).mirror), inf, \step),
32         \ctranspose,    Pgate(Pwhite(0,5), inf, \step) +
33                                 Pgate(Pseq([0,7,0,-7], inf), inf, \step1),
34         \dur, 0.2
35 ).play