Week 2 lesson 2 - manipulating time with setcps, cps patterns and fast/slow functions

Hi all, here's a new video, exploring ways of manipulating time. I enjoyed this one!

  • 1:19 - Changing tempo with setcps, and converting between bpm and cps
  • 4:44 - Patterning tempo changes with the cps effect
  • 7:24 - Using the 'fast' function, including a bit about the '$', for making sure things are worked out in the right order
  • 9:18 - Slowing down with 'slow' (or fast with a 'speed' of less than one)
  • 9:51 - Using parenthesis, also for making sure things are worked out in the right order
  • 10:48 - Giving the fast / slow factor as a pattern (aka "weird time travel")

Here's a worksheet to go with it:

-- Time to look at Time

-- "Music is the Time of Numbers"

-- setcps - change global tempo

-- Let's run two patterns at once:
d1 $ n "0 2 [3 5] [4 7]" # sound "cpu"

d2 $ n "0(3,8) 8*8" # sound "cpu2"
  # squiz 5

-- Changing the cps (cycles per second) changes everything
setcps 0.7

setcps 0.3

-- Time as an effect (!)

-- You can also set cps as an effect:
d2 $ n "0(3,8) 8*8" # sound "cpu2"
  # squiz 5
  # cps 0.5

-- It's still global though - setting it on one pattern will
-- change it everywhere

-- However, you can pattern it:
d2 $ n "0(3,8) 8*8" # sound "cpu2"
  # squiz 5
  # cps "0.5 1"

-- You can really mess with time in this way!
d2 $ n "0 [~ 1] 2*2 3 4*3 5 ~ 7" # sound "cpu2"
    # cps "<0.5 2> [1 0.75] <2 1>"

-- Reset things before moving on..

setcps 0.6

-- 'fast' and 'slow' functions

-- You can speed up / slow down an individual
-- pattern (or part of one) with "fast" and "slow"

d1 $ slow 2 $ n "0 2 [3 5] [4 7]" # sound "cpu"

d1 $ fast 2 $ n "0 2 [3 5] [4 7]" # sound "cpu"

-- You can also pattern this speed factor:
d1 $ slow "0.5 1" $ n "0 2 [3 5] [4 7]" # sound "cpu"

d1 $ slow "0.5 <1 2>" $ n "0 2 [3 5] [4 7]" # sound "cpu"

-- When patterning time in this way, you're switching
-- between different versions of the pattern, running
-- at different speeds.

-- We've already learned enough to create patterns with a
-- lot of variety in them, by mixing together several simple
-- manipulations
d1 $ slow "0.5 <1 2>" $
  n "{0 2 [3 5] [4 <7 6>], 0*2 3*3 0}" # sound "cpu"
  # squiz "<8 1 2>"

-- Note that the 'speed' effect changes the rate of playback
-- for each sample, but doesn't change the overall speed of the
-- pattern
d1 $ slow "0.5 <1 2>" $
    n "{0 2 [3 5] [4 <7 6>], 0*2 3*3 0}" # sound "cpu"
    # squiz "<8 1 2>"
    # speed 2

-- I find things always sound better if you speed them up a little.
-- Your experience may vary :)
setcps 0.7

Next lesson:


I'm still puzzling how to make the lessons easier to navigate in the forum. For now I've 'pinned this' as the latest lesson, so it should appear at the top of the cycle0 category. If you go to the bottom of the top post, you should see a link to "Cycle zero - index", where lessons are now in reverse order, i.e. with the latest one at the top. I also made the index a 'banner topic' but I'm not sure if that's a bit too intrusive.. You can 'dismiss' it if you want.


Time travel, hooray!

I did get some kind of headache when trying to "ungolf" a very simple example :

d1 $ fast "0.5 2" $ n "0 1" #sound "cpu"
... didn't understand why it seems to start on "0 [1 0]

I found out that this didn't work :

d1 $ sound "cpu*4" # n "0 1 0 ~ 0 1 1"

then i went this wrong way

d1 $ n "<[0 1] 0> <1 [0 1]>" # sound "cpu"

the road to this was strange :

d1 $ n "<0 1> <[0 1]>" # sound "cpu"
Still not so clear though!

I'll watch the video again, but it would be really great to have a little more on the topic!

Otherwise I like the banner topic, it makes my navigation easier.

One particular doubt : Week 1 lesson 5 - mini-notation part 4 : video mini notation part 4 seems to follow up on Week 1 lesson 4 - mini-notation part 2 - mini notation part 2.
Did I miss out on part 3?

Hey @gnozo

(First of all - this is hard to get your head round so don't worry if it doesn't make sense right away. Even Alex is confused about this in the video ha. Personally I avoid confusion by not really thinking about it and using my ear to decide what I like the sound of...)

Patterning fast in this way means you effectively switch between two versions of the pattern running at different speeds.

So imagine your original pattern "0 1" looks like this:


If you applied fast 0.5 to the whole thing it would look like this:


If you applied fast 2 to the whole thing it would look like this:


When you pattern fast you switch between those two versions of the patterns. In this instance we will have half a cycle of fast 0.5 and half a cycle of fast 2

So using / to indicate the two halves of the pattern, it's a bit like layering:




alternating parts each time:


So thinking about your pattern:

d1 $ n "<0 1> <[0 1]>" # sound "cpu"

It works in the same way. Let's look at the first half <0 1> first:


Then the second half <[0 1]>


If we put these together we get:


Which is the same as what we saw above.

Hopefully that helps! I think @yaxu has some really good diagrams that explain how Tidal handles patterns of effects and time, so hopefully he can share them!


Also I just noticed @yaxu also posted a link to 'Patterns I Have Known and Loved' - a book he's writing on Tidal, which has good diagrams and goes into some detail. Looks like page 11 might be helpful to you :slight_smile:


Can confirm I'm easily confused about this. There's a jump in the video at that point because I cut out an explanation that was totally wrong! Thanks @heavy.lifting, great explanation!

1 Like

To be fair it is mega confusing. I don't think I really understood this until the summer school last year....

1 Like

Thank you so much for patiently walking me through the way it works!

It's clear this way, I for one need to tinker around a lot in order to get used to it. Also, I think I'm now starting to get why you advocate using your ear to decide... Although I do that with real life instruments, with sequencers I just noticed I tend to prioritise so-called intentions ; ironically, just like with real life instruments, thinking can hinder the imagination? (baffled)
Excited about getting used to the mechanics for this reason now.
Thanks also for the direct reference to the book, another dimension-warp portal opens!

1 Like

@gnozo I find it hard to know if thinking is good or bad. You can definitely think too much as you say, but there have also been times when performing that I should have used my brain a bit more. Practice helps, of course, as does becoming more confident with the syntax (maybe removing some of the need to think) (... but again, practicing too much can use up all your improvisational energies).

Like when I play a synthesiser. I don't need to understand how an oscillator works to press this key and hear a sound. But IF I understand the oscillator it helps me understand how to manipulate the sound in the way I want. But if I ONLY worry about the oscillator... am I still making good music?

There is definitely a sweet spot for such things :slight_smile:


I'm really fascinated with these questions, thanks a lot for your words! Surely thinking isn't all bad, otherwise we wouldn't...er..
Wait, wrong start! I entirely agree that a good instrument doesn't make good music alone.

Improvisation is sometimes defined as the automatic application of acquired skills. For instance, in jazz, the idea of improvisation is very deeply rooted in the integration of harmonic progressions and all sorts of codes and habits which relate to domestication rather than spontaneity. Flirting with the norm, hijacking it...

As you underline, becoming confident with the syntax is necessary in order to navigate around "freely". When it comes to odd beats, it might become slightly trickier to get it to "groove", while improvising, without a sweet/deep (body/mind?) understanding of operations such as the one you have detailed above. Here's a rather cheesy song I like a lot, some acid-like Gispy-Turkish-maëlström. I'll try to tinker around with this type of stuff and see where it gets me :space_invader:


@yaxu Maybe you could share with us the function / tool that 'illustrates' a structure of the pattern? I believe that you have been prototyping something like this...

edit: So I reviewed the videos and realized that you shared the
drawLine $ "[x [a c b]/2 x x, a x [c d]]" example.

1 Like

One fanciful way to think of the $ is as marking the metrical feet of the code, just like . does for the mini-notation

1 Like

Hi all, I added a table of contents to the video now. I added it to the original post although the easiest way to access it on the video description so you can jump about in the video if you want.

1 Like

great lesson!
I still find a bit hard to understand what means splitting the cycle in two halves and how the events get distributed...
Btw, is it possible to use setcps to go back to the default value or we have to execute setcps 0.5625


You could think of it as a window into different versions of a pattern. fast "1 2" causes two versions of the pattern to run, one running normally and one twice as fast. Then you switch between listening to the first version and the second version, but they're both running all the time.

Hm, no.. you could add the alias reset = setcps 0.5625 to your BootTidal.hs, then you could just run reset.

1 Like

thank you for the visual input, it helped me allot

I am fascinated by manipulating time in a different way of traditional DAWs as you mentioned earlier.

Here is a newbie question about the logic of pattern generation:

d1 $ slow "1" $ n "0 2" # s "cpu"
-- | bd sn | bd sn | bd sn | bd sn |
-- Ok (of course ;)

d1 $ slow "2 1" $ n "0 2" # s "cpu"
-- results in:
-- | bd sn | sn sn | bd sn | sn sn |
-- why not:
-- | bd sn |    sn | bd sn |    sn |

d1 $ slow "3 1" $ n "0 2" # s "cpu"
-- | bd sn |    sn |    sn | bd sn |
-- Ok

d1 $ slow "4 1" $ n "0 2" # s "cpu"
-- results in:
-- | bd sn |    sn | sn sn |    sn |
-- why not:
-- | bd sn |    sn |    sn |    sn |

The why-not's mark where I expect a different outcome and right now am not able to understand what is actually happening. Probably I am still at odds on how two patterns interact.

Hi @mbutz, basically you're switching between two versions of a pattern, one running slower than the other. I think @heavy.lifting explained it nicely in this comment: Week 2 lesson 2 - manipulating time with setcps, cps patterns and fast/slow functions

1 Like