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

**URL:** <https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466>\
**Category:** Week 2 - effects, time, arithmetic\
**Created:** [20 April 2020 14:05 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466 "2020-04-20T14:05:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [20 April 2020 14:05 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/1 "2020-04-20T14:05:49Z")

</div>

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

[![](https://img.youtube.com/vi/ARCZE_XLhfk/maxresdefault.jpg "[TidalClub] Week 2 lesson 2 - manipulating time with setcps, cps patterns and fast/slow functions") ](https://www.youtube.com/watch?v=ARCZE_XLhfk)

- [1:19](https://www.youtube.com/watch?v=ARCZE_XLhfk&t=79s) - Changing tempo with setcps, and converting between bpm and cps
- [4:44](https://www.youtube.com/watch?v=ARCZE_XLhfk&t=284s) - Patterning tempo changes with the cps effect
- [7:24](https://www.youtube.com/watch?v=ARCZE_XLhfk&t=444s) - Using the 'fast' function, including a bit about the '$', for making sure things are worked out in the right order
- [9:18](https://www.youtube.com/watch?v=ARCZE_XLhfk&t=558s) - Slowing down with 'slow' (or fast with a 'speed' of less than one)
- [9:51](https://www.youtube.com/watch?v=ARCZE_XLhfk&t=591s) - Using parenthesis, also for making sure things are worked out in the right order
- [10:48](https://www.youtube.com/watch?v=ARCZE_XLhfk&t=648s) - Giving the fast / slow factor as a pattern (aka "weird time travel")

Here's a worksheet to go with it:

```plaintext
-- 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..
hush

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:**

> [@Week 2 lesson 3 - Combining patterns with arithmetic, plus the 'hurry' function](https://club.tidalcycles.org/t/week-2-lesson-3-combining-patterns-with-arithmetic-plus-the-hurry-function/489):
>
> Here's another video as promised. To tell the truth, I'm super tired at the moment, so despite a couple of takes the video ended up a bit "non-linear", with an explanation of the 'hurry' function dropped in the middle of an exploration of the different ways of combining control patterns of the same type. For the same reason of tiredness, I haven't managed to put together a worksheet for this tonight, but will get to that tomorrow, and hopefully some reference material with diagrams. Anyway, her…

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [21 April 2020 08:47 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/2 "2020-04-21T08:47:05Z")

</div>



---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [21 April 2020 08:50 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/3 "2020-04-21T08:50:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gnozo](https://uzu.lurk.org/user_avatar/uzu.lurk.org/gnozo/32/100_2.png) [@gnozo](https://uzu.lurk.org/u/gnozo)\
**Post date:** [22 April 2020 04:33 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/4 "2020-04-22T04:33:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![heavy.lifting](https://uzu.lurk.org/user_avatar/uzu.lurk.org/heavy.lifting/32/150_2.png) [@heavy.lifting](https://uzu.lurk.org/u/heavy.lifting)\
**Post date:** [22 April 2020 09:54 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/5 "2020-04-22T09:54:03Z")

</div>

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:

`0---1---|0---1---|0---1---|0---1---|`

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

`0-------|1-------|0-------|1-------|`

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

`0-1-0-1-|0-1-0-1-|0-1-0-1-|0-1-0-1-|`

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:

`0---/----|1---/----|0---/----|1---/----|`

and

`0-1-/0-1-|0-1-/0-1-|0-1-/0-1-|0-1-/0-1-|`

alternating parts each time:

`0---/0-1-|1---/0-1-|0---/0-1-|1---/0-1-|`

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:

`0-------|1-------|0-------|1-------|`

Then the second half `<[0 1]>`

`----0-1-|----0-1-|----0-1-|----0-1-|`

If we put these together we get:

`0---0-1-|1---0-1-|0---0-1-|1---0-1-|`

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!

---

<div class="post-metadata">

**Author:** ![heavy.lifting](https://uzu.lurk.org/user_avatar/uzu.lurk.org/heavy.lifting/32/150_2.png) [@heavy.lifting](https://uzu.lurk.org/u/heavy.lifting)\
**Post date:** [22 April 2020 09:57 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/6 "2020-04-22T09:57:25Z")

</div>

Also I just noticed @yaxu also posted a link to ['Patterns I Have Known and Loved'](https://club.tidalcycles.org/t/reference-text-patterns-i-have-known-and-loved/478) - 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 🙂

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [22 April 2020 10:28 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/7 "2020-04-22T10:28:13Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![heavy.lifting](https://uzu.lurk.org/user_avatar/uzu.lurk.org/heavy.lifting/32/150_2.png) [@heavy.lifting](https://uzu.lurk.org/u/heavy.lifting)\
**Post date:** [22 April 2020 10:35 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/8 "2020-04-22T10:35:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gnozo](https://uzu.lurk.org/user_avatar/uzu.lurk.org/gnozo/32/100_2.png) [@gnozo](https://uzu.lurk.org/u/gnozo)\
**Post date:** [22 April 2020 13:16 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/9 "2020-04-22T13:16:19Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![heavy.lifting](https://uzu.lurk.org/user_avatar/uzu.lurk.org/heavy.lifting/32/150_2.png) [@heavy.lifting](https://uzu.lurk.org/u/heavy.lifting)\
**Post date:** [22 April 2020 15:43 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/10 "2020-04-22T15:43:40Z")

</div>

@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 🙂

---

<div class="post-metadata">

**Author:** ![gnozo](https://uzu.lurk.org/user_avatar/uzu.lurk.org/gnozo/32/100_2.png) [@gnozo](https://uzu.lurk.org/u/gnozo)\
**Post date:** [22 April 2020 21:49 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/11 "2020-04-22T21:49:24Z")

</div>

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](https://www.youtube.com/watch?v=-wae9-LbgJ8). I'll try to tinker around with this type of stuff and see where it gets me 👾

---

<div class="post-metadata">

**Author:** ![phlux](https://uzu.lurk.org/user_avatar/uzu.lurk.org/phlux/32/153_2.png) [@phlux](https://uzu.lurk.org/u/phlux)\
**Post date:** [22 April 2020 21:58 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/12 "2020-04-22T21:58:14Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Alanza](https://uzu.lurk.org/user_avatar/uzu.lurk.org/alanza/32/3179_2.png) [@Alanza](https://uzu.lurk.org/u/Alanza)\
**Post date:** [23 April 2020 15:06 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/13 "2020-04-23T15:06:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [25 April 2020 07:53 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/14 "2020-04-25T07:53:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fran](https://uzu.lurk.org/user_avatar/uzu.lurk.org/fran/32/508_2.png) [@fran](https://uzu.lurk.org/u/fran)\
**Post date:** [28 May 2020 16:13 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/15 "2020-05-28T16:13:03Z")

</div>

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  
?

Cheers

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [28 May 2020 19:30 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/16 "2020-05-28T19:30:48Z")

</div>

> [@fran](#):
>
> I still find a bit hard to understand what means splitting the cycle in two halves and how the events get distributed...

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.

> [@fran](#):
>
> Btw, is it possible to use setcps to go back to the default value or we have to execute setcps 0.5625

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

---

<div class="post-metadata">

**Author:** ![jaimedr](https://uzu.lurk.org/user_avatar/uzu.lurk.org/jaimedr/32/972_2.png) [@jaimedr](https://uzu.lurk.org/u/jaimedr)\
**Post date:** [3 September 2020 10:52 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/17 "2020-09-03T10:52:18Z")

</div>

thank you for the visual input, it helped me allot

---

<div class="post-metadata">

**Author:** ![jaimedr](https://uzu.lurk.org/user_avatar/uzu.lurk.org/jaimedr/32/972_2.png) [@jaimedr](https://uzu.lurk.org/u/jaimedr)\
**Post date:** [3 September 2020 11:09 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/18 "2020-09-03T11:09:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbutz](https://uzu.lurk.org/user_avatar/uzu.lurk.org/mbutz/32/1085_2.png) [@mbutz](https://uzu.lurk.org/u/mbutz)\
**Post date:** [21 October 2020 18:37 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/19 "2020-10-21T18:37:14Z")

</div>

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

```haskell
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.

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [21 October 2020 21:45 UTC](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/20 "2020-10-21T21:45:53Z")

</div>

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 - #5 by heavy.lifting](https://club.tidalcycles.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466/5)

[Next page](https://uzu.lurk.org/t/week-2-lesson-2-manipulating-time-with-setcps-cps-patterns-and-fast-slow-functions/466.md?page=2)
