Haskell in Tidal Cycles: useful keywords

Hi everyone and nice to meet you! First post here :wave:

Exploring Documentation, Reference and TC's posts sometimes I come across useful keywords like this...

d1 $ s "bd*4"
d2 $ s "~ cp ~ cp"

...that permits to play d1 and d2 with a single value command.

Or this...

let plyCato num amt = plyWith num (|* legato amt)
    plyDown num amt = plyWith num (|* gain amt)

...to add custom functions.

Where can I find specific documentation about this topic?

I hope I was clear! :smiley:


Hello! I think this syntax elements (guess that's what they are) are related to Tidal being embedded in Haskell. You could find more on this kind of things (like conditional statements for example) going through some Haskell documentation.

1 Like

Thanks @ninioArtillero! In fact now I am studying Haskell๐Ÿ™ƒ


You're welcome. I've been learning Haskell myself, and have to say is quite elegant programming (from a mathematicians point of view).

The reason why knowing some Haskell is relevant for extending and hacking Tidal (beyond the fact it's programmed on it) is that when you run Tidal, say when you load Tidal Cycles plugin in atom, what happens under the hood is that the Tidal haskell library is loaded/imported into GHCi (interactive compiler for Haskell). So, in naive terms, Haskell is continually interpreting whatever Tidal code you enter.

1 Like