Difference between revisions of "palindrome"

From TidalCycles userbase
Jump to: navigation, search
(Undo revision 1281 by Yaxu (talk))
Tag: Undo
Line 1: Line 1:
{{DISPLAYTITLE:brak}}  
+
{{DISPLAYTITLE:palindrome}}  
[[Type signature|Type]]: <source inline>brak :: Pattern a -> Pattern a</source>
+
[[Type signature|Type]]: <source inline>palindrome :: Pattern a -> Pattern a</source>
  
'''brak''' makes a pattern sound a bit like a breakbeat. It does this by every other cycle, squashing the pattern to fit half a cycle, and offsetting it by a quarter of a cycle.
+
The '''palindrome''' function applies [[rev]] to a pattern [[every]] other cycle, so that the pattern alternates between forwards and backwards.
 +
 
 +
For example this:
 +
 
 +
<source>
 +
d1 $ palindrome $ sound "arpy:0 arpy:1 arpy:2 arpy:3"
 +
</source>
 +
 
 +
... is the same as this:
 +
 
 +
<source>
 +
d1 $ slow 2 $ sound "arpy:0 arpy:1 arpy:2 arpy:3 arpy:3 arpy:2 arpy:1 arpy:0"
 +
</source>
 +
 
 +
 
 +
... and indeed this:
  
 
<source>
 
<source>
d1 $ brak $ sound "[feel feel:3, hc:3 hc:2 hc:4 ho:1]"
+
d1 $ every 2 rev $ sound "arpy:0 arpy:1 arpy:2 arpy:3"
 
</source>
 
</source>
  
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 17:27, 24 November 2018

Type: palindrome :: Pattern a -> Pattern a

The palindrome function applies rev to a pattern every other cycle, so that the pattern alternates between forwards and backwards.

For example this:

d1 $ palindrome $ sound "arpy:0 arpy:1 arpy:2 arpy:3"

... is the same as this:

d1 $ slow 2 $ sound "arpy:0 arpy:1 arpy:2 arpy:3 arpy:3 arpy:2 arpy:1 arpy:0"


... and indeed this:

d1 $ every 2 rev $ sound "arpy:0 arpy:1 arpy:2 arpy:3"