trigger

From TidalCycles userbase
Revision as of 23:11, 17 April 2019 by Yaxu (talk | contribs) (Created page with "Type: <syntaxhighlight lang="haskell" inline>trigger :: Show a => a -> Pattern b -> Pattern b</syntaxhighlight> The '''trigger''' function causes the patte...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Type: trigger :: Show a => a -> Pattern b -> Pattern b

The trigger function causes the pattern passed to it to be 'reset' every time its evaluated. In the following example, the gain envelope resets each time the pattern is run:

d1 $ sound "bd*2 cp:4(5,8,<0 2>)"
  # gain (trigger 1 $ slow 2 envL)

Or similarly with a dj filteR:

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

The first parameter is the id of the pattern that does the triggering. In the above examples, it's 1, so in this case d1 is triggering itself.

In this example, running the d2 pattern resets the envelope in the d1 pattern:

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

d2 $ sound "~ arpy*2"