# Week 4 lesson 1 - continuous patterns - sine, square, tri, saw and random functions

**URL:** <https://uzu.lurk.org/t/week-4-lesson-1-continuous-patterns-sine-square-tri-saw-and-random-functions/608>\
**Category:** Week 4 - waveforms, randomness\
**Created:** [3 May 2020 17:20 UTC](https://uzu.lurk.org/t/week-4-lesson-1-continuous-patterns-sine-square-tri-saw-and-random-functions/608 "2020-05-03T17:20:23Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [4 May 2020 13:35 UTC](https://uzu.lurk.org/t/week-4-lesson-1-continuous-patterns-sine-square-tri-saw-and-random-functions/608/10 "2020-05-04T13:35:17Z")

</div>

First of all, a simple example

```haskell
d1 $ sound "bd" # speed 2

```

vs

```haskell
d1 $ speed 2 # sound "bd"

```

These have exactly the same result.

This would also be the same, because although 'speed' is given twice, when you use `#`, the value is taken from the right.

```haskell
d1 $ speed 5 # sound "bd" # speed 2

```

The next one would _also_ be the same. There are two events on the right, but with `#`, the rhythm comes from the `bd` on the left. That `bd` starts at the start of the cycle, when the `2` of speed is active, so you end up with a single `bd` with a speed of `2`.

```haskell
d1 $ sound "bd" # speed "2 5"

```

The `$` does something quite different from `#`. The `#` is combining the `sound "bd"` and `speed "2"` patterns into a single pattern. The `$` is just there to make sure everything it 'worked out' on its right, before being passed to `d1` to be sent to superdirt.

I talk about combining patterns with `#` and friends here:

> [@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…

and I talk about `$` here:

> [@Week 3 lesson 1 - exploring the 'every' function, including tackling the meaning of '$'](https://club.tidalcycles.org/t/week-3-lesson-1-exploring-the-every-function-including-tackling-the-meaning-of/502):
>
> Before getting on to working with longer samples, here's something about the every function. It's a nice clear example of how functions work, and gives us the opportunity to start to get a feel for how parenthesis and $ works. I also go through how to add an effect as a function. I had a lot of problems with corrupted subtitle files which I won't go into.. and only after editing the subtitles noticed that my friend the vertical grey oblong decided to join me in the video. They're not really in …

Does that help @antonelse?

---

_[View the full topic](https://uzu.lurk.org/t/week-4-lesson-1-continuous-patterns-sine-square-tri-saw-and-random-functions/608)._
