Difference between revisions of "ply"

From TidalCycles userbase
Jump to: navigation, search
m
m (Yaxu moved page Ply to ply)
 
(2 intermediate revisions by 2 users not shown)
Line 23: Line 23:
  
 
<syntaxhighlight lang="haskell">
 
<syntaxhighlight lang="haskell">
s "[bd bd bd] ~ [sn sn] [cp cp]"
+
s "[bd bd] ~ [sn sn sn] [cp cp cp]"
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 32: Line 32:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
[[Category:Functions]] [[Category:Pattern Transformers]]
+
[[Category:Functions]]

Latest revision as of 22:23, 9 December 2018

Type: ply :: Pattern Int -> Pattern a -> Pattern a

The ply function repeats each event the given number of times. For example

ply 3 $ s "bd ~ sn cp"

... is equivalent to ...

s "[bd bd bd] ~ [sn sn sn] [cp cp cp]"

The first parameter may be given as a pattern, so that:

ply "2 3" $ s "bd ~ sn cp"

... is equivalent to ...

s "[bd bd] ~ [sn sn sn] [cp cp cp]"

Here is an example of it being used conditionally:

d1 $ every 3 (ply 4) $ s "bd ~ sn cp"