# striateAt, chopAt (Custom functions for loop sampling)

**URL:** <https://uzu.lurk.org/t/striateat-chopat-custom-functions-for-loop-sampling/4870>\
**Category:** TidalCycles\
**Tags:** resources\
**Created:** [13 September 2023 05:05 UTC](https://uzu.lurk.org/t/striateat-chopat-custom-functions-for-loop-sampling/4870 "2023-09-13T05:05:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![geikha](https://uzu.lurk.org/user_avatar/uzu.lurk.org/geikha/32/2701_2.png) [@geikha](https://uzu.lurk.org/u/geikha)\
**Post date:** [13 September 2023 05:05 UTC](https://uzu.lurk.org/t/striateat-chopat-custom-functions-for-loop-sampling/4870/1 "2023-09-13T05:05:05Z")

</div>

Hello!

I thought I'd share some of my most used custom functions in some posts since I've been developing a very specific livecoding style:

* * *

## The functions

```haskell
let striateAt str at f = slow at $ striate (fast at $ str) f
    chopAt str at f = slow at $ chop (fast at $ str) f
    sloopAt str at f = loopAt at $ striate (fast at $ str) f
    striateAt' str at f = striateAt (str |* at) (fmap toRational at) f
    chopAt' str at f = chopAt (str |* at) (fmap toRational at) f
    sloopAt' str at f = sloopAt (str |* at) (fmap toRational at) f
    strat = striateAt
    chat = chopAt
    slat = sloopAt
    strat' = striateAt'
    chat' = chopAt'
    slat' = sloopAt'

```

* * *

## Breakdown

### striateAt

`striateAt` (shorthand `strat`) takes two numbers and a pattern. The first number is the amount of bits into which to cut the sample into (as regular `striate`), the second one is the amount of cycles it will gather the bits along. And then the pattern of which to take the sound.

[See `striate` on the docs](http://tidalcycles.org/docs/reference/sampling/#striate).

```haskell
d1 $ strat 64 4 "bev" # cut 1

```

#### Prime variants

The prime variant (`striateAt'` and `strat'`) makes it more intuitive, as you can simply tell it how many bits you want per cycle. So it's easier to think about using quarter notes or eigth notes, regardless of how long the sample will take to loop.

```haskell
d1 $ strat' "16 8" 8 "bev" # cut 1 # rel 0.1

```

Also, remember you can specify begin and ends times by separating the pattern to be striated with a `$`:

```haskell
d1 $ strat' 16 2 $ "bev" # cut 1 # rel 0.2 # begin (1/2) # end (3/4)

```

### chopAt

Like `striateAt`, but uses and acts like chop.

```haskell
d1 $ strat' 8 2 $ "breaks125*2" # bpf 4000 # coarse 2

d1 $ chat' 8 2 $ "breaks125*2" # bpf 4000 # coarse 2

```

### sloopAt

`sloopAt` (or `slat`), uses the `loopAt` function to define the length of the loop in cycles. It's very useful for when you want to use a long `loopAt` but you don't want those super long samples playing forever when you hush them:

```haskell
d1 $ slat' 16 2 "breaks125:1" # gain "[1 0 0 1]*4"

```

* * *

That's it for now, I'll keep posting groups of custom funcs every now and then 🙂

---

<div class="post-metadata">

**Author:** ![ganz](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ganz/32/64_2.png) [@ganz](https://uzu.lurk.org/u/ganz)\
**Post date:** [14 September 2023 09:57 UTC](https://uzu.lurk.org/t/striateat-chopat-custom-functions-for-loop-sampling/4870/2 "2023-09-14T09:57:14Z")

</div>

Thank you so much @geikha for sharing your custom functions. They are awesome!!!

I am experimenting for a while with longer drum and synth loops, to chop them up, which seems to be very interesting to me, but for example your `strat` seems to be the next level to me. This is real fun to chop loops with your custom functions. This is what I was always dreaming of, especially for chopping drum loops.

Just two annotations for the moment.

It is even more fun to create a folder with lets says some variants of your drumloop and then play with irand.

```haskell
d1 $ strat' "8 16" 8 "drum_loop" # cut 1 # rel 0.5 # gain 0.8 # irand 8

```

And I like to create exact timed breaks in experimenting with begin and end.

```haskell
d1 $ fast 2 $ strat' 16 "<2>" $ "drum_loop" # cut 1 # rel 0.1
    # begin (1/"<2 2 2 4>") # end ("<3 3 3 3 3 3 1 3>"/4)

```

Here en example:

[https://www.instagram.com/p/CxKt1GRPdWS/](https://www.instagram.com/p/CxKt1GRPdWS/)
