slice

From TidalCycles userbase
Jump to: navigation, search

Type: Pattern Int -> Pattern Int -> ControlPattern -> ControlPattern

slice is similar to chop and striate, in that it's used to slice up a pattern into bits. The difference is that it allows you to rearrange those bits as a pattern.

d1 $ slice 8 "7 6 5 4 3 2 1 0" $ sound "breaks165"
  # legato 1

The above slices the sample into eight bits, and then plays them backwards, equivalent of applying rev $ chop 8. Here's a more complex example:

d1 $ slice 8 "[<0*8 0*2> 3*4 2 4] [4 .. 7]" $ sound "breaks165"
  # legato 1

Note that the order of the first two parameters changed in tidal version 1.0.0