Difference between revisions of "cat"

From TidalCycles userbase
Jump to: navigation, search
(Marked this version for translation)
 
(One intermediate revision by the same user not shown)
Line 36: Line 36:
 
</source>
 
</source>
  
<!--T:11-->
+
= timeCat = <!--T:11-->
 +
[[Type signature|Type]]: <source inline>timeCat :: [(Time, Pattern a)] -> Pattern a</source>
 +
 
 +
<!--T:12-->
 +
'''timeCat''' is like '''fastcat''' except that you provide proportionate sizes of the patterns to each other for when they're concatenated into one cycle. The larger the value in the list, the larger relative size the pattern takes in the final loop. If all values are equal then this is equivalent to '''fastcat''', e.g. the following two code fragments are equivalent.
 +
 
 +
<source>
 +
d1 $ fastcat [s "bd*4", s "hh27*8", s "superpiano" # n 0]
 +
</source>
 +
 
 +
<source>
 +
d1 $ timeCat [(1, s "bd*4"),
 +
              (1, s "hh27*8"),
 +
              (1, s "superpiano" # n 0)]
 +
</source>
 +
 
 +
<!--T:14-->
 
'''See also: [[append]], [[append#fastAppend|fastAppend]]'''
 
'''See also: [[append]], [[append#fastAppend|fastAppend]]'''
  

Latest revision as of 20:03, 24 December 2020

Other languages:
British English • ‎English • ‎français

Type: cat :: [Pattern a] -> Pattern a

cat, (also known as slowcat, to match with fastcat defined below) concatenates a list of patterns into a new pattern; each pattern in the list will maintain its original duration. For example:

d1 $ cat [sound "bd*2 sn", sound "arpy jvbass*2"]

d1 $ cat [sound "bd*2 sn", sound "arpy jvbass*2", sound "drum*2"]

d1 $ cat [sound "bd*2 sn", sound "jvbass*3", sound "drum*2", sound "ht mt"]

fastcat

Type: fastcat :: [Pattern a] -> Pattern a

fastcat works like cat above, but squashes all the patterns to fit a single cycle. Examples:

d1 $ fastcat [sound "bd*2 sn", sound "arpy jvbass*2"]

d1 $ fastcat [sound "bd*2 sn", sound "arpy jvbass*2", sound "drum*2"]

d1 $ fastcat [sound "bd*2 sn", sound "jvbass*3", sound "drum*2", sound "ht mt"]

timeCat

Type: timeCat :: [(Time, Pattern a)] -> Pattern a

timeCat is like fastcat except that you provide proportionate sizes of the patterns to each other for when they're concatenated into one cycle. The larger the value in the list, the larger relative size the pattern takes in the final loop. If all values are equal then this is equivalent to fastcat, e.g. the following two code fragments are equivalent.

d1 $ fastcat [s "bd*4", s "hh27*8", s "superpiano" # n 0]
d1 $ timeCat [(1, s "bd*4"),
              (1, s "hh27*8"),
              (1, s "superpiano" # n 0)]

See also: append, fastAppend