# Tidal ≥1.0.11 \`trigger\` function

**URL:** https://forum.toplap.org/t/tidal-1-0-11-trigger-function/424
**Category:** TidalCycles
**Created:** [18 April 2019 15:25 UTC](https://forum.toplap.org/t/tidal-1-0-11-trigger-function/424 "2019-04-18T15:25:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jarm](https://forum.toplap.org/user_avatar/forum.toplap.org/jarm/32/1018_2.png) [@jarm](https://forum.toplap.org/u/jarm)
#### Post date: [18 April 2019 15:25 UTC](https://forum.toplap.org/t/tidal-1-0-11-trigger-function/424/1 "2019-04-18T15:25:27Z")

</div>

There’s a super interesting new function `trigger`, which aims to replace `retrig`:

[https://tidalcycles.org/index.php/trigger](https://tidalcycles.org/index.php/trigger)

Although it’s not mentioned in the above docs, this also works with named patterns!

It’s in early development so it would be good to discuss how it could be refined. I think @yaxu is already planning an additional quantise parameter.

One suggestion I had:

> When using the ID parameter, it will trigger when silencing the other pattern, which I think is undesirable, e.g.:

```haskell
d1 $ sound "bd*2 cp:4(5,8,<0 2>)" 
  # djf (trigger 2 $ range 0.1 0.9 $ slow 2 envL) 

d2 $ silence -- will trigger above

```

[Meta: not sure how to format the above code block to Haskell, anyone?]  
[Admin: I just enabled this - write ‘haskell’ immediately after the first three backticks. You might need to refresh your browser for it to work.]

---

<div class="post-metadata">

### Author: ![yaxu](https://forum.toplap.org/user_avatar/forum.toplap.org/yaxu/32/3_2.png) [@yaxu](https://forum.toplap.org/u/yaxu)
#### Post date: [22 April 2019 06:33 UTC](https://forum.toplap.org/t/tidal-1-0-11-trigger-function/424/2 "2019-04-22T06:33:13Z")

</div>

As far as Tidal is concerned, `silence` is a pattern the same as any other. If you run `p "foo" silence` then `list`, it’ll list it as running.  
For your above use case I think we need a separate function called `stop` or similar (e.g. `stop "foo"`) that _really_ stops a pattern.

As for `trigger` UI, howabout

- `trigger` - on its own, triggers on evaluation (i.e. as now but without having to give a pattern id)
- `triggerFrom` - the current `trigger`
- `triggerWith` - retrigger using a pattern of bools, e.g. `d1 $ s "bd*8" # gain (triggerWith $ slow 8 "t" envL)` to retrigger every 8 cycles

That would be an evolution from the current `trigger` function, but actually I think I’d prefer the last one in the list being called `trigger` as the starting point. Then we could have:

Trigger from pattern:

```haskell
d1 $ s "bd*8" # gain (trigger $ slow 8 envL)

```

Trigger from last eval of current pattern id:

```haskell
d1 $ s "bd*8" # gain (trigger onEval)

```

Trigger from last eval of another pattern id:

```haskell
d1 $ s "bd*8" # gain (trigger $ onEvalId 2)

```

---

<div class="post-metadata">

### Author: ![jarm](https://forum.toplap.org/user_avatar/forum.toplap.org/jarm/32/1018_2.png) [@jarm](https://forum.toplap.org/u/jarm)
#### Post date: [22 April 2019 09:11 UTC](https://forum.toplap.org/t/tidal-1-0-11-trigger-function/424/3 "2019-04-22T09:11:16Z")

</div>

> [@yaxu](#):
>
> I think we need a separate function called `stop` or similar (e.g. `stop "foo"` ) that _really_ stops a pattern.

Agreed this would be useful, probably for other reasons too. Perhaps `stopIn n` cycles too?

I like all your suggestions for `trigger` 👍
