# Difference between revisions of "someCycles"

From TidalCycles userbase

m |
|||

Line 14: | Line 14: | ||

As with <syntaxhighlight lang="haskell" inline>sometimesBy</syntaxHighlight>, if you want to be specific, you can use <syntaxhighlight lang="haskell" inline>someCyclesBy</syntaxHighlight> and a number. For example <syntaxhighlight lang="haskell">someCyclesBy 0.93 (# speed 2)</syntaxhighlight> will apply the <syntaxhighlight lang="haskell" inline>speed</syntaxhighlight> control on average 93 cycles out of a hundred. | As with <syntaxhighlight lang="haskell" inline>sometimesBy</syntaxHighlight>, if you want to be specific, you can use <syntaxhighlight lang="haskell" inline>someCyclesBy</syntaxHighlight> and a number. For example <syntaxhighlight lang="haskell">someCyclesBy 0.93 (# speed 2)</syntaxhighlight> will apply the <syntaxhighlight lang="haskell" inline>speed</syntaxhighlight> control on average 93 cycles out of a hundred. | ||

− | [[Category:Functions]] [[Category:Higher-order functions]] [[Category:Randomness and chance]] | + | [[Category:Functions]] [[Category:Higher-order functions]] [[Category:Randomness and chance]] [[Category:Conditional Transformers]] |

## Revision as of 21:35, 25 November 2018

*See also: sometimes*

Type: `someCycles :: (Pattern a -> Pattern a) -> Pattern a -> Pattern a`

**someCycles** is similar to sometimes, but instead of applying the given function to random events, it applies it to random cycles. For example the following will either distort all of the events in a cycle, or none of them:

```
d1 $ someCycles (# crush 2) $ n "0 1 [~ 2] 3" # sound "arpy"
```

# someCyclesBy

As with `sometimesBy`

, if you want to be specific, you can use `someCyclesBy`

and a number. For example

```
someCyclesBy 0.93 (# speed 2)
```

will apply the `speed`

control on average 93 cycles out of a hundred.