seqP

From TidalCycles userbase
Jump to: navigation, search

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

seqP allows you sequence patterns, with start and end times. The code below contains three separate patterns in a “stack”, but each has different start times (zero cycles, eight cycles, and sixteen cycles, respectively). In the example, all patterns stop after 12 cycles:

d1 $ seqP [ 
  (0, 12, sound "bd bd*2"), 
  (4, 12, sound "hh*2 [sn cp] cp future*4"), 
  (8, 12, sound (samples "arpy*8" (run 16)))
]

If you run the above, you probably won’t hear anything. This is because cycles start ticking up as soon as you start Tidal, and you have probably already gone part cycle 12.

You can reset the cycle clock back to zero by running setcps (-1) followed by setcps 1 (nb: at the time of writing, this doesn't yet work in version 1.0.0 of tidal, but you can instead run resetCycles), or whatever tempo you want to restart at. Alternatively, you can shift time for the seqP pattern back to zero like this:

d1 $ (pure now) ~> seqP [ 
  (0, 12, sound "bd bd*2"), 
  (4, 12, sound "hh*2 [sn cp] cp future*4"), 
  (8, 12, sound (samples "arpy*8" (run 16)))
]

Currently, In tidal 1.0.0, pure now is not yet implemented. So the following can be used instead:

do
{
  resetCycles;
  d1 $ seqP [ 
    (0, 12, sound "bd bd*2"), 
    (4, 12, sound "hh*2 [sn cp] cp future*4"), 
    (8, 12, sound (samples "arpy*8" (run 16)))
  ]
}

seqPLoop

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

A third option is to use seqPLoop instead, which will keep looping the sequence when it gets to the end:

d1 $ (pure now) ~> seqPLoop [ 
  (0, 12, sound "bd bd*2"), 
  (4, 12, sound "hh*2 [sn cp] cp future*4"), 
  (8, 12, sound (samples "arpy*8" (run 16)))
]

Currently, In tidal 1.0.0, pure now is not yet implemented. So the following can be used instead:

do
{
  resetCycles;
  d1 $ seqPLoop [ 
  (0, 12, sound "bd bd*2"), 
  (4, 12, sound "hh*2 [sn cp] cp future*4"), 
  (8, 12, sound (samples "arpy*8" (run 16)))
]