Difference between revisions of "zoom"
From TidalCycles userbase
(updated for new type signature) |
|||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:zoom}} | {{DISPLAYTITLE:zoom}} | ||
− | [[Type signature|Type]]: <source inline>zoom :: | + | [[Type signature|Type]]: <source inline>zoom :: (Time, Time) -> Pattern a -> Pattern a</source> |
Plays a portion of a pattern, specified by the beginning and end of a time span (known as an 'arc'). The new resulting pattern is played over the time period of the original pattern: | Plays a portion of a pattern, specified by the beginning and end of a time span (known as an 'arc'). The new resulting pattern is played over the time period of the original pattern: | ||
<source> | <source> | ||
− | d1 $ zoom ( | + | d1 $ zoom (0.25, 0.75) $ sound "bd*2 hh*3 [sn bd]*2 drum" |
</source> | </source> | ||
Line 17: | Line 17: | ||
<source> | <source> | ||
− | d1 $ every 4 (zoom ( | + | d1 $ every 4 (zoom (0.25, 0.75)) $ sound "bd*2 hh*3 [sn bd]*2 drum" |
</source> | </source> | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Time Functions]] | [[Category:Time Functions]] |
Latest revision as of 19:07, 19 December 2018
Type: zoom :: (Time, Time) -> Pattern a -> Pattern a
Plays a portion of a pattern, specified by the beginning and end of a time span (known as an 'arc'). The new resulting pattern is played over the time period of the original pattern:
d1 $ zoom (0.25, 0.75) $ sound "bd*2 hh*3 [sn bd]*2 drum"
In the pattern above, zoom is used with an arc from 25% to 75%. It is equivalent to this pattern:
d1 $ sound "hh*3 [sn bd]*2"
Here’s an example of it being used with a conditional:
d1 $ every 4 (zoom (0.25, 0.75)) $ sound "bd*2 hh*3 [sn bd]*2 drum"