# 260 Drum Machine Patterns

**URL:** <https://uzu.lurk.org/t/260-drum-machine-patterns/2921>\
**Category:** TidalCycles\
**Tags:** resources\
**Created:** [20 February 2021 22:43 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921 "2021-02-20T22:43:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellocatfood](https://uzu.lurk.org/user_avatar/uzu.lurk.org/hellocatfood/32/42_2.png) [@hellocatfood](https://uzu.lurk.org/u/hellocatfood)\
**Post date:** [20 February 2021 22:43 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/1 "2021-02-20T22:43:44Z")

</div>

I'm doing a presentation where I take drum machine patterns found in popular music and recreate and mutate them using TidalCycles. The drum machine patterns I'm using as source material comes from the book [260 Drum Machine Patterns](https://www.halleonard.com/product/657371/260-drum-machine-patterns). It's from the 80s and has some great pattens in!

For the presentation I've transcribed a few into TidalCycles notation and thought I'd share them here. If anyone wants to transcribe and share others here please do! The book's still available in print and I recommend it.

Note about my transcriptions: mine are flipped i.e. BD is the first line. Also I used a pattern of #gain functions for programming accents. If there's a more efficient way please share. Also also I just googled the tempos but use whatever's comfortable.

```haskell
-- Funk 13
setcps(90/60/4)

d1
$ stack [
struct ("1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0") $ sound "bd",
struct ("0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1") $ sound "sd",
struct ("1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0") $ sound "hc"
]
# gain "1 1 1.3 1 1 1 1 1 1 1 1 1 1.3 1 1 1"

```

```haskell
-- Pop 10
setcps(100/60/4)

d1
$ stack [
struct ("1 0 1 0 0 0 0 0 1 1 0 1 0 1 0 1") $ sound "bd",
struct ("0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0") $ sound "sd",
struct ("0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1") $ sound "ho",
struct ("1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0") $ sound "hc"
]
# gain "1 1 1 1 1.3 1 1 1 1 1 1 1 1.3 1 1 1"

```

```haskell
-- Disco 8
setcps(120/60/4)

d1
$ stack [
struct ("1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0") $ sound "bd",
struct ("1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0") $ sound "cp",
struct ("0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0") $ sound "sd",
struct ("0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1") $ sound "ho",
struct ("1 1 1 0 0 1 1 0 1 1 1 0 0 1 1 0") $ sound "hc"
]

```

```haskell
-- Rock 12
setcps(110/60/4)

d1
$ stack [
struct ("1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0") $ sound "bd",
struct ("0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0") $ sound "sd",
struct ("1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0") $ sound "hc"
]
# gain "1 1 1 1 1.3 1 1 1 1 1 1 1 1.3 1 1 1"

```

```haskell
-- R&B 12
setcps(80/60/4)

d1
$ stack [
struct ("1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 0") $ sound "bd",
struct ("0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0") $ sound "sd",
struct ("0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0") $ sound "ho",
struct ("1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1") $ sound "hc"
]
# gain ("1 1 1 1 1.3 1 1 1 1.3 1 1 1 1.3 1 1 1")

```

---

<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 February 2021 09:28 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/2 "2021-02-21T09:28:24Z")

</div>

Still _very much_ of a beginner, I did experiment in a similar way with some of these [Dance Music Rudiments](http://users.skynet.be/shedo/DMR1/Dance%20Music%20Rudiments6.htm).

I used `set` functions to be able to change the drum kit. If this could be done easier or more elegantly I am very much open for suggestions.

Generally I think in case of the representation of drum machine patterns it boils down to a balance between transparency (can you _see_ what will happen) versus economy (can you easily edit and change things) or: can you omit redundancy and explicitness without loosing clarity and flexiblity. In this respect your version, @hellocatfood, is much easier to comprehend.

```haskell
do
  setI "i" $ 0 -- i = hihat
  setI "s" $ 10 -- s = snare
  setI "k" $ 4 -- k = kick
  setS "f" $ "ab" -- f = kit or folder

do
  setI "i" $ 2
  setI "s" $ 1
  setI "k" $ 0
  setS "f" $ "drum"

do
  setI "i" $ 5 -- 5, 28
  setI "s" $ 2 -- 2, 20, 22, 23
  setI "k" $ 13
  setS "f" $ "gretsch"

setcps (150/60/4)

d1 $ stack [
   (slow 2 $ n "^i ~ ^i ~ ^i ~ ^i ^i ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ ^i ~ " # s "^f"),
   (slow 2 $ n "~ ~ ~ ~ ^s ~ ~ ~ ~ ^s ~ ~ ~ ~ ^s ~ ~ ~ ~ ~ ~ ~ ^s ~ ~ ^s ~ ~ ^s ~ ~ ~ " # s "^f"),
   (slow 2 $ n "^k ~ ~ ~ ~ ~ ~ ~ ~ ~ ^k ~ ~ ~ ~ ~ ~ ~ ^k ~ ~ ~ ~ ~ ~ ~ ^k ~ ~ ~ ~ ~ " # s "^f")
]

-- or, with some additional randomization and short syntax
-- (which makes it much more dense to understand)

d1 $ stack [
   (n "[^i ~ ^i ~]*4" # s "^f"),
   (n "<~!4 ^s ~!3 ~!4 ^s ~!3 . ~!4 ~ ~ ^s ~ ~!4 ^s ~ ~ ~ >" # gain "1" # s "^f"),
   (n "<~ ~ ^s ~ ~ ~ ~ ~ ^s ~ ~ [^s ^s] ~ ~ ^s ^s . ~ ~ ~ ~ ^s ~ ~ ~ ~ ~ ^s ~ ~ ~ ~ ~ >" # gain (range 0.35 0.75 rand) # s "^f"),
   (n "<^k ~!3 ~ ~ ^k ~ ~ ~ ^k ~ ~!4 . ~ ~ ^k ~ ~!4 ^k ~!3 ~!4>" # s "^f")
]

```

---

<div class="post-metadata">

**Author:** ![antc](https://uzu.lurk.org/user_avatar/uzu.lurk.org/antc/32/3443_2.png) [@antc](https://uzu.lurk.org/u/antc)\
**Post date:** [23 February 2021 03:24 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/3 "2021-02-23T03:24:03Z")

</div>

I'd love to work through some of this with you folks! Is there a place I can find scans of the book for free? I was curious about why you used super long struct strings to define the rhythms, but then I saw the cover of the book and it made sense lol.

---

<div class="post-metadata">

**Author:** ![junior3](https://uzu.lurk.org/user_avatar/uzu.lurk.org/junior3/32/612_2.png) [@junior3](https://uzu.lurk.org/u/junior3)\
**Post date:** [23 February 2021 04:41 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/4 "2021-02-23T04:41:45Z")

</div>

There is a version available at [archive.org](http://archive.org):

> **[260 Drum Machine Patterns : Rene-Pierre Bardet : Free Download, Borrow, and...](https://archive.org/details/260DrumMachinePatterns)**
>
> 260 patterns of various styles for drum machine programming. 

---

<div class="post-metadata">

**Author:** ![polymorphic.engine](https://uzu.lurk.org/user_avatar/uzu.lurk.org/polymorphic.engine/32/30_2.png) [@polymorphic.engine](https://uzu.lurk.org/u/polymorphic.engine)\
**Post date:** [23 February 2021 09:56 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/5 "2021-02-23T09:56:46Z")

</div>

Love your idea of transcribing the patterns!

> [@hellocatfood](#):
>
> If there's a more efficient way please share.

A way to avoid always typing it out would be this function:

```haskell
    accent :: [Integer] -> Pattern ControlMap
    accent ds = gain accs
            where accs = withEvent (\e -> if elem (eventPartStart e) fracs then e{value = 1.3 } else e) ("1*16"::Pattern Double)
                  fracs = [(i-1)%16 | i <- ds]

```

The function takes a list of values from 1 to 16 and will accentuate the notes in the corresponding beats.  
So now you could type:

```haskell
d1
$ stack [
struct ("1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0") $ sound "bd",
struct ("0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1") $ sound "sd",
struct ("1 0 1 1 1 0 1 0 1 1 0 1 0 1 1 0") $ sound "hc"
]
# accent [3,13]

```

Edit: I just tried it with sound and apperently it doesn't work unfortunately. I'll have to think about it some more haha

---

<div class="post-metadata">

**Author:** ![polymorphic.engine](https://uzu.lurk.org/user_avatar/uzu.lurk.org/polymorphic.engine/32/30_2.png) [@polymorphic.engine](https://uzu.lurk.org/u/polymorphic.engine)\
**Post date:** [26 February 2021 17:54 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/6 "2021-02-26T17:54:25Z")

</div>

So here is some code that actually works, if someone is interested:

```haskell
accent ds = gain (fast 16 $ Sound.Tidal.Core.fromList accs)
          where accs = [f x | x <- [1..16]]
                f x = if elem x ds then 1.3 else 1

```

---

<div class="post-metadata">

**Author:** ![hellocatfood](https://uzu.lurk.org/user_avatar/uzu.lurk.org/hellocatfood/32/42_2.png) [@hellocatfood](https://uzu.lurk.org/u/hellocatfood)\
**Post date:** [4 March 2021 16:30 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/7 "2021-03-04T16:30:15Z")

</div>

Thanks, this works great! I think for the presentation I'm doing I'll stick to the way of transcribing I'm currently using but if I transcribe more and post them here I'll use your method.

---

<div class="post-metadata">

**Author:** ![hellocatfood](https://uzu.lurk.org/user_avatar/uzu.lurk.org/hellocatfood/32/42_2.png) [@hellocatfood](https://uzu.lurk.org/u/hellocatfood)\
**Post date:** [10 April 2021 15:37 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/8 "2021-04-10T15:37:42Z")

</div>

Here's the presentation I mentioned where I used the drum patterns

[https://www.youtube.com/watch?v=MMTIdAGu0R4](https://www.youtube.com/watch?v=MMTIdAGu0R4)

I'll be working on transcribing the rest of the drum patterns into Tidal notation at some point

---

<div class="post-metadata">

**Author:** ![Xon](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/x/838e76/32.png) [@Xon](https://uzu.lurk.org/u/Xon)\
**Post date:** [30 April 2021 13:39 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/9 "2021-04-30T13:39:56Z")

</div>

Hello,

fyi, I've just found that library of drum patterns (almost 500) in SC:  
[https://github.com/lvm/SuperUtilities/blob/master/classes/DrumLoop.sc](https://github.com/lvm/SuperUtilities/blob/master/classes/DrumLoop.sc)  
and its equivalent in Tidal (but I have not tested it) :  
[https://github.com/lvm/tidal-drum-patterns](https://github.com/lvm/tidal-drum-patterns)

Christophe

---

<div class="post-metadata">

**Author:** ![hellocatfood](https://uzu.lurk.org/user_avatar/uzu.lurk.org/hellocatfood/32/42_2.png) [@hellocatfood](https://uzu.lurk.org/u/hellocatfood)\
**Post date:** [2 May 2021 16:22 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/10 "2021-05-02T16:22:27Z")

</div>

oh wow that's amazing! Thanks for sharing and thanks @mauro for making it!

---

<div class="post-metadata">

**Author:** ![khoparzi](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/k/c37758/32.png) [@khoparzi](https://uzu.lurk.org/u/khoparzi)\
**Post date:** [5 May 2021 13:01 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/11 "2021-05-05T13:01:48Z")

</div>

This is cool!

I did a gist with a collection of popular beats from a drum YouTuber a couple of years back.

> <https://gist.github.com/khoparzi/622b7892a95444a2ee9930d432561985>

Maybe its time to get cracking on the this new book you suggested.

---

<div class="post-metadata">

**Author:** ![Raph](https://uzu.lurk.org/user_avatar/uzu.lurk.org/raph/32/45_2.png) [@Raph](https://uzu.lurk.org/u/Raph)\
**Post date:** [6 May 2021 09:28 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/12 "2021-05-06T09:28:23Z")

</div>

Fun experiment. I wanted to play these patterns while retaining the ability to see them in my editor. I am using _vim-tidal_. I just mapped various shortcuts in my `.vimrc` that I can summon when editing `.tidal` files:

```
autocmd FileType tidal call s:tidal_abbr()
function! s:tidal_abbr()
    inoreabbr billybd "[t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~]"
    inoreabbr billysn "[~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~]"
    inoreabbr billych "[t ~ t ~] [t ~ t ~] [t ~ t ~] [t ~ t ~]"
    inoreabbr bluemondaybd "[t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~]"
    inoreabbr bluemondaysn "[~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~]"
    inoreabbr bluemondaycp "[~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~]"
    inoreabbr bluemondayoh "[~ ~ t ~] [~ ~ t ~] [~ ~ t ~] [~ ~ t ~]"
    ... etc ...
endfunction

```

I could have found better names for them but so far so good.

---

<div class="post-metadata">

**Author:** ![mashaal](https://uzu.lurk.org/user_avatar/uzu.lurk.org/mashaal/32/2100_2.png) [@mashaal](https://uzu.lurk.org/u/mashaal)\
**Post date:** [10 July 2022 11:38 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/13 "2022-07-10T11:38:33Z")

</div>

I was wondering how to make this a bit more dynamic, where you can pass the pattern length as the second parameter... it seems I run into a type error when doing this...

```haskell
accent ds lg = gain (fast lg $ Sound.Tidal.Core.fromList accs)
          where accs = [f x | x <- [1..lg]]
                f x = if elem x ds then 1.3 else 1

```

Where `lg` is length

The error is...

`enumFromTo: not supported for patterns`

---

<div class="post-metadata">

**Author:** ![polymorphic.engine](https://uzu.lurk.org/user_avatar/uzu.lurk.org/polymorphic.engine/32/30_2.png) [@polymorphic.engine](https://uzu.lurk.org/u/polymorphic.engine)\
**Post date:** [10 July 2022 11:51 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/14 "2022-07-10T11:51:17Z")

</div>

The following should work

```haskell
let 
_accent :: Int -> [Int] -> ControlPattern
_accent l ds = gain (fast (pure $ fromIntegral l) $ Sound.Tidal.Context.fromList accs)
          where accs = [f x | x <- [1..l]]
                f x = if elem x ds then 1.3 else 1
accent = tParam _accent

```

Note that the arguments are switched though

---

<div class="post-metadata">

**Author:** ![ptrklv](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/p/8edcca/32.png) [@ptrklv](https://uzu.lurk.org/u/ptrklv)\
**Post date:** [15 July 2022 22:38 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/15 "2022-07-15T22:38:27Z")

</div>

> [@Xon](#):
>
> and its equivalent in Tidal (but I have not tested it) :  
> [https://github.com/lvm/tidal-drum-patterns](https://github.com/lvm/tidal-drum-patterns)
> 
> Christophe

Hi i was wondering if anyone tested @mauro drum pattern for tidal and can help me out. After the installation I get this errors for every module when I try to ghci :browse the module

Here's an example:

**:**  **error:**

**Could not find module ‘Sound.Tidal.Drum.Amen’**

**It is not a module in the current program, or in any known package.**

Prelude\>

I am fairly new to tidal and haskell so its bit confusing to me, seems like I have wrong directory?

Thanks

---

<div class="post-metadata">

**Author:** ![joanq](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@joanq](https://uzu.lurk.org/u/joanq)\
**Post date:** [9 November 2022 19:24 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/16 "2022-11-09T19:24:04Z")

</div>

I'm working on the idea of having rhythm patterns pre-written in order to invoke them quickly in a live situation.

In [GitHub - Rafrobeat/tidal-drum-patterns: TidalCycles / Haskell modules of drum patterns.](https://github.com/Rafrobeat/tidal-drum-patterns) there is a big list of patterns, forked from the one by lvm linked in the comments above, with some corrections and some new entries.

The problem I find there is that it's slow to use them in a live situation: first, you have to import the rhythm you want (`import Sound.Tidal.Drum.ItaloDisco1a as I`), and then you can use it as `struct (I.bd) $ s "bd"` and so on.

I'm putting together a refactoring of this code, in order to make using these patterns a much more immediate thing.

In my `BootTidal.hs`, I include another file called `rhythm.hs` with this content:

```haskell
import qualified Data.Map as M

afro1a = M.fromList [("bd", "[t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] " :: Pattern Bool), ("hh", "[t ~ t t] [t ~ t ~] [t ~ t ~] [t ~ t ~] " :: Pattern Bool), ("rim", "[~ ~ ~ ~] [~ ~ t ~] [~ ~ t ~] [~ ~ t ~] " :: Pattern Bool) ]
afro1b = M.fromList [("bd", "[t ~ ~ ~] [~ ~ ~ ~] [t ~ t ~] [~ ~ t ~] " :: Pattern Bool), ("hh", "[t ~ t t] [t ~ t ~] [t ~ t ~] [t ~ t ~] " :: Pattern Bool), ("rim", "[~ ~ ~ ~] [~ ~ t ~] [~ ~ ~ ~] [t ~ ~ ~] " :: Pattern Bool) ]

rhythms = M.fromList [("afro1a", afro1a), ("afro1b", afro1b)]

r name instrument = struct (M.findWithDefault ("" :: Pattern Bool) instrument (M.findWithDefault M.empty name rhythms))

```

With this, you get a new function `r` (because I can't spell rhythm quickly without mistakes) that you can use like this:

```haskell
d1 $ r "afro1a" "hh" $ s "808hc"

```

This seems to work, and the idea is adding some/all the rhythms in here.

Note that I'm fairly new to Haskell and there are some things I would like to improve:

- I can't split these dictionaries in multiple lines without the Haskell interpreter complaining.
- I can't add the `r` signature without the interpreter complaining (it doesn't like the expression `r ::` in this context).
- I would like to hide the `afro1a`, `afro1b` and `rhythms` names from the global scope.

Apart from that, what do you think about this idea?

---

<div class="post-metadata">

**Author:** ![bgold](https://uzu.lurk.org/user_avatar/uzu.lurk.org/bgold/32/383_2.png) [@bgold](https://uzu.lurk.org/u/bgold)\
**Post date:** [13 November 2022 18:33 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/17 "2022-11-13T18:33:35Z")

</div>

Using an "hs" file means things are getting executed as if you were in interactive mode (ghci), so your first two problems can be solved by using the multiline delimiters `:{` and `:}`.

But being in interactive mode means you can't (as far as I know) easily hide the names in a different scope - I think at best you could obfuscate the names by prefixing them with underscores but that's not particularly elegant.

---

<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:** [16 November 2022 09:23 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/18 "2022-11-16T09:23:08Z")

</div>

This should work:

```haskell
:{
r name instrument = struct (M.findWithDefault ("" :: Pattern Bool) instrument (M.findWithDefault M.empty name rhythms))
  where rhythms = M.fromList [("afro1a", afro1a), ("afro1b", afro1b)] 
        afro1a = M.fromList [("bd", "[t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] " :: Pattern Bool), ("hh", "[t ~ t t] [t ~ t ~] [t ~ t ~] [t ~ t ~] " :: Pattern Bool), ("rim", "[~ ~ ~ ~] [~ ~ t ~] [~ ~ t ~] [~ ~ t ~] " :: Pattern Bool) ]
        afro1b = M.fromList [("bd", "[t ~ ~ ~] [~ ~ ~ ~] [t ~ t ~] [~ ~ t ~] " :: Pattern Bool), ("hh", "[t ~ t t] [t ~ t ~] [t ~ t ~] [t ~ t ~] " :: Pattern Bool), ("rim", "[~ ~ ~ ~] [~ ~ t ~] [~ ~ ~ ~] [t ~ ~ ~] " :: Pattern Bool) ]
:}

```

You should be able to add the type signature in there as well

---

<div class="post-metadata">

**Author:** ![joanq](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@joanq](https://uzu.lurk.org/u/joanq)\
**Post date:** [18 November 2022 18:45 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/19 "2022-11-18T18:45:35Z")

</div>

This is my code right now:

```haskell
import qualified Data.Map as M

:{

rhythms = M.fromList [
  ("afro1a",
  M.fromList [
    ("bd", "[t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] " :: Pattern Bool),
    ("hh", "[t ~ t t] [t ~ t ~] [t ~ t ~] [t ~ t ~] " :: Pattern Bool),
    ("rim", "[~ ~ ~ ~] [~ ~ t ~] [~ ~ t ~] [~ ~ t ~] " :: Pattern Bool) ]
    ),
...
  ("yamama",
  M.fromList [
    ("bd", "[t ~ ~ ~] [~ ~ ~ t] [t ~ ~ ~] [~ ~ ~ ~]" :: Pattern Bool),
    ("cr", "[~ ~ ~ ~] [t ~ ~ ~] [~ ~ ~ ~] [t ~ ~ ~]" :: Pattern Bool) ]
  )
  ]

:}

let
_r name instrument = struct (M.findWithDefault ("" :: Pattern Bool) instrument (M.findWithDefault M.empty name rhythms))
r = tParam2 _r

```

It works fine, and can invoke any of them and pattern them with just:

```haskell
r "<funk7c afro1a afro1b>" "hh" $ s "efmhhclose" # gain 0.9,

```

```haskell

```

---

<div class="post-metadata">

**Author:** ![ghales](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghales/32/2171_2.png) [@ghales](https://uzu.lurk.org/u/ghales)\
**Post date:** [19 November 2022 20:25 UTC](https://uzu.lurk.org/t/260-drum-machine-patterns/2921/20 "2022-11-19T20:25:36Z")

</div>

Love to see this. Makes me hope someday there'll be a package-manager like tool for everyone to share loops with each other.

[Next page](https://uzu.lurk.org/t/260-drum-machine-patterns/2921.md?page=2)
