Difference between revisions of "slice"

From TidalCycles userbase
Jump to: navigation, search
Line 23: Line 23:
 
[[Type]]: <source inline>splice :: Int -> Pattern Int -> ControlPattern -> ControlPattern</source>
 
[[Type]]: <source inline>splice :: Int -> Pattern Int -> ControlPattern -> ControlPattern</source>
  
'''splice''' is similar to <source inline>slice</source>, but the slices are sped up or down to fit the slot in the target pattern.
+
'''splice''' is similar to <source inline>slice</source>, but the slices are automatically pitched up or down to fit their 'slot'.
  
 
<source>
 
<source>

Revision as of 06:03, 19 April 2019

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

slice is similar to chop and striate, in that it's used to slice samples up 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

See also bite, which is similar but slices up patterns, rather than samples.

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

splice

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

splice is similar to slice, but the slices are automatically pitched up or down to fit their 'slot'.

d1 $ splice 8 "[<0*8 0*2> 3*4 2 4] [4 .. 7]" $ sound "breaks165"