Difference between revisions of "zoom"

From TidalCycles userbase
Jump to: navigation, search
m (Yaxu moved page Zoom to zoom)
(updated for new type signature)
 
Line 1: Line 1:
 
{{DISPLAYTITLE:zoom}}  
 
{{DISPLAYTITLE:zoom}}  
[[Type signature|Type]]: <source inline>zoom :: Arc -> Pattern a -> Pattern a</source>
+
[[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 (Arc 0.25 0.75) $ sound "bd*2 hh*3 [sn bd]*2 drum"
+
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 (Arc 0.25 0.75)) $ sound "bd*2 hh*3 [sn bd]*2 drum"
+
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 18: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"