# Week 6, lesson 1 - canons with "off"

**URL:** <https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123>\
**Category:** Week 6 - canons, scales, controlling MIDI etc\
**Created:** [22 May 2020 19:55 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123 "2020-05-22T19:55:58Z")\
**Posts on this page:** 7\
**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:** [22 May 2020 19:55 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/1 "2020-05-22T19:55:58Z")

</div>

A little bit ahead of time, here's an intro to a function close to my heart, `off`.

[![](https://img.youtube.com/vi/uWVfteb71vc/maxresdefault.jpg "TidalClub week 6 lesson 1 - canons with 'off'") ](https://www.youtube.com/watch?v=uWVfteb71vc)

- [0:38](https://www.youtube.com/watch?v=uWVfteb71vc&t=38s) - technical aside - what the 'type' is for the "off" function
- [1:30](https://www.youtube.com/watch?v=uWVfteb71vc&t=90s) - what "off" actually does - example with bitcrushing
- [4:04](https://www.youtube.com/watch?v=uWVfteb71vc&t=244s) - example with using "off" with adding to the note value
- [5:38](https://www.youtube.com/watch?v=uWVfteb71vc&t=338s) - shorthands for fractions - q, e, s, etc
- [7:32](https://www.youtube.com/watch?v=uWVfteb71vc&t=452s) - using off with more complicated melodies
- [8:20](https://www.youtube.com/watch?v=uWVfteb71vc&t=500s) - using legato / sustain to make synthesised notes longer
- [11:15](https://www.youtube.com/watch?v=uWVfteb71vc&t=675s) - how to specify negative numbers (in parenthesis, or put it in mininotation double quotes)
- [12:51](https://www.youtube.com/watch?v=uWVfteb71vc&t=771s) - using 'off' with percussive rhythms, and patterning the time offset

Here's the worksheet:

```haskell

-- Let's start with two notes:
d1 $ n "c e" # sound "supermandolin"

-- What does 'off' do? Switch between the above and below versions to hear
-- the difference.
d1 $ off 0.25 (# crush 4) $ n "c e" # sound "supermandolin"

-- You can hear that the original two notes are untouched, but there is
-- something else added.

-- 'off' takes three inputs; a number, a function and a pattern.
-- What it does is leave the original pattern as is, but adds a copy of
-- it on top. That copy is offset in time by the number given in the first
-- input - the number. The copy also has the function applied to it.
-- So we end up with a version of the pattern that 'follows' the original
-- in time, and is transformed. In this case, it is distorted.

-- Instead of using the bitcrush effect, lets add to the 'n' note, instead.
d1 $ off "0.25" (|+ n 7) $ n "c e" # sound "supermandolin"

-- Now we hear a simple 'canon' - it sounds like one voice following another.

-- We can swap '0.25' for the shorthand 'q', which stands for a *q*uarter of a
-- cycle.
d1 $ off "q" (|+ n 7) $ n "c e" # sound "supermandolin"

-- Lets change that for 'e', which stands for an eighth of a cycle.
d1 $ off "e" (|+ n 7) $ n "c e" # sound "supermandolin"

-- Here's the current list of shorthands available:
-- w = 1 (whole)
-- h = 0.5 (half)
-- q = 0.25 (quarter)
-- e = 0.125 (eighth)
-- s = 0.0624 (sixteenth)
-- t = 1/3 (third)
-- f = 0.2 (fifth)

-- You can have multiples of these shorthands by prefixing them with a
-- number, for example:
d1 $ off "2f" (|+ n 7) $ n "c a f e" # sound "supermandolin"

-- For a 32nd, you could do 0.5s:
d1 $ off "0.5s" (|+ n 7) $ n "c a f e" # sound "supermandolin"

-- Let's try with a more complex pattern:
d1 $ off "e" (|+ n 7) $ n (slow 2 "c(3,8) a(3,8) f(5,8) e*2")
  # sound "supermandolin"

-- The notes are getting very short now, to match the shorter 'step' sizes
-- within this denser pattern. To make them proportionally longer we can
-- use legato, for example to make them all twice as long:
d1 $ off "e" (|+ n 7) $ n (slow 2 "c(3,8) a(3,8) f(5,8) e*2")
  # sound "supermandolin"
  # legato 2

-- Or alternatively we can use sustain for a duration in seconds:
d1 $ off "e" (|+ n 7) $ n (slow 2 "c(3,8) a(3,8) f(5,8) e*2")
  # sound "supermandolin"
  # sustain 0.75

-- We can pattern the 'n' of the transformed version of the pattern:
d1 $ off "e" (|+ n "<7 12 -5>") $ n (slow 2 "c(3,8) a(3,8) f(5,8) e*2")
  # sound "supermandolin"
  # sustain 0.75

-- In the above the 7 - 12 - -5 pattern repeats every third cycle, and the
-- c a f e one repeats every two cycles (due to the slow 2). The combination
-- of (or interference between) them repeats lasts six cycles.

-- Lets add another 'off', this time offset by a sixteenth of a cycle, and
-- dropping the octave.
d1 $ off "s" (|+ n (-12)) $ off "e" (|+ n "<7 12 -5>") $
 n (slow 2 "c(3,8) a(3,8) f(5,8) e*2")
 # sound "supermandolin"
 # sustain 0.75

-- Note that negative numbers have to be in parenthesis, otherwise Haskell
-- gets confused and things you're trying to do a subtraction!

-- This isn't the case in the mininotation, so an alternative is to put
-- all negative numbers in double quotes:
d1 $ off "s" (|+ n "-12") $ off "e" (|+ n "<7 12 -5>") $
 n (slow 2 "c(3,8) a(3,8) f(5,8) e*2")
 # sound "supermandolin"
 # sustain 0.75

-- The same principles can be applied to percussion, for example:
d1 $ off "<s q e>" (# squiz 2) $ n "{0 1 [~ 2] 3*2, 5 ~ 3 6 4}"
  # sound "cpu2"
  # sustain 0.75

-- Notice the offset is patterned in the above, so the 'following'
-- pattern shifts forwards and backwards.

```

```haskell

```

---

<div class="post-metadata">

**Author:** ![szalwiarz](https://uzu.lurk.org/user_avatar/uzu.lurk.org/szalwiarz/32/51_2.png) [@szalwiarz](https://uzu.lurk.org/u/szalwiarz)\
**Post date:** [24 May 2020 15:34 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/2 "2020-05-24T15:34:54Z")

</div>

Didn't know Lorenzo Senni was also a supermandolin connoisseur 🤯

---

<div class="post-metadata">

**Author:** ![vasily.milovidov](https://uzu.lurk.org/user_avatar/uzu.lurk.org/vasily.milovidov/32/125_2.png) [@vasily.milovidov](https://uzu.lurk.org/u/vasily.milovidov)\
**Post date:** [24 May 2020 17:56 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/3 "2020-05-24T17:56:12Z")

</div>

what a great function!

---

<div class="post-metadata">

**Author:** ![ofiuco](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ofiuco/32/425_2.png) [@ofiuco](https://uzu.lurk.org/u/ofiuco)\
**Post date:** [25 May 2020 16:41 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/4 "2020-05-25T16:41:52Z")

</div>

So cool!!  
By the way, have you explain "iter" function already? I don't remember it from previous lessons :S

---

<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:** [26 May 2020 08:16 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/5 "2020-05-26T08:16:12Z")

</div>

Yes I went through it as 'function of the week' here: [FOTW#1 - iter](https://club.tidalcycles.org/t/fotw-1-iter/1091)

---

<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:** [29 May 2020 02:03 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/6 "2020-05-29T02:03:10Z")

</div>

Very cool !  
Sidenote : I noticed something fun and weird, because i forgot to add a sound :

`d1 $ "d e f"` produces sound...!

---

<div class="post-metadata">

**Author:** ![mariusz](https://uzu.lurk.org/user_avatar/uzu.lurk.org/mariusz/32/429_2.png) [@mariusz](https://uzu.lurk.org/u/mariusz)\
**Post date:** [8 June 2020 11:41 UTC](https://uzu.lurk.org/t/week-6-lesson-1-canons-with-off/1123/7 "2020-06-08T11:41:44Z")

</div>

small addition, as it might be useful to have things in a single place 🙂  
In the livestream about TidalCycles 1.5.0 release, @yaxu mentioned a new shorthand -  
"x" - 1/6 (sixth)
