Your first patterns in TidalCycles

From here on out, we'll be assuming that you have

So now it's time to make your very first TidalCycles pattern, a simple four-on-the-floor bass drum pattern. Type the following into your .tidal file and hit ctrl-enter on the line

d1 $ s "bd*4"

if everything is installed and working correctly you should hear a steady, fairly quick, pattern of even bass drum hits. This is your very first pattern!

It should sound like

Now that you're playing a pattern, here's a lesson on how to stop the music. Go to another line, type hush and then press ctrl-enter again. This stops all music that's playing.

Let's start breaking down what's happening in this pattern.

The first thing on the line, the d1, tells us that we're going to send a pattern of sounds to our first channel for audio. We can actually have a total of 16 of these going at once, each executing different patterns, but usually you don't need more than five or six for a given piece of music. Now I can tell you that if you want to stop just a single channel of music then you can do d1 silence instead, with the 1 replaced by whatever channel you're trying to stop.

The next part that comes after that is the s "bd*4". The s means "take a pattern of sounds and turn them into something that can be played". The part in between the quotation marks is the pattern itself. In this case, you can read it as "play four samples called 'bd'" per cycle. Ah, cycle, that's an important word here: a cycle is the basic unit of time in Tidal. It is, by default, a little more than two seconds. Tidal will fit the number of sound events you tell it to in each cycle, as fast or as slow as it needs to.

For example, if you type s "bd*8" instead you'll get eight bass drum samples per cycle, played closer together. If you changed it to just two samples there'd be a lot more dead air between drum hits.

Now that would be pretty boring if you could only do even beats in Tidal, and thankfully you can do a lot more than that. We're going to take our four-beat pattern and then break it apart into something equivalent

d1 $ s "bd bd bd bd"

This is still four beats per cycle, but now let's take each one of the beats in the pulse of the pattern—the pulse being the basic underlying rhythm—and make it more complicated, using square brackets [] to group together events together. Another things we're going to use is that ~ represents silence, a rest in the pattern.

d1 $ s "[~ bd*2] bd*4 ~ bd*8"

This still has a pulse of four because there's only four groups of things in the pattern, but how the different sounds are placed in the pattern is different for each quarter of the cycle: the first quarter is half silent then puts two bass drums in the next eight of the cycle, the quarter after that fits four bass drums, the quarter after that is silent, and the last quarter has eight bass drums in it. You can hear how each of these pieces has a different rhythm inside it.

We've already alluded to the fact that we can have multiple sounds at a time, so let's hear a complementary hihat pattern to go along with this. We can do something like the following in order to play both samples at once in similar patterns, running each line with ctrl+enter like before.

Caution: you do need a line of space between the two of these for the code to work.

d1 $ s "bd*4"

d2 $ s "hh27*4"

And if you've run both of these you'll be able to hear the tick of the hihat hit at the start of each quarter, showing the the two different patterns have the same underlying pulse.

Actually, it doesn't actually sound great to have them both starting at exactly the same time. So we're going to introduce our first transformation of patterns. Change the hihat pattern to look like the following

d2 $ ((1/8) ~>) $ s "hh27*4"

This transformation shifts a pattern in time, moving the timing of events in the pattern over by an eighth of a cycle. Why an eighth? Because if you have four events per cycle then if you want to try and offset the hihats to not start on the quarters like the bass drums, then you need to shift it by something less than 1/4.

Go ahead and try messing around with the value to see if there's an amount you like better than just 1/8th.

The important thing I want to point out is that transformations of patterns come between those $ symbols and before the pattern you're transforming. We'll be introducing more transformations soon and you can just keep chaining them by adding more dollars signs and putting more things between them.

At this point, it's really time to introduce a couple more concepts that will be important for us: making patterns that vary over time and adding our first hints of randomness into our patterns.