Pattern structure with `euclid` function

Hi, new to Tidal, played a bit with haskell ages ago, got a ton of questions!

I'd like to reproduce the following pattern with the euclid function instead of the parenthesis notation:

d1 $ sound "bass(3,8)" # note (run 8)`

Here, the structure is taken from bass(3,8), and the note will be selected based on the alignment between the two patterns.

Now, if I write:

d1 $ euclid 3 8 $ sound "bass" # note (run 8)

Here, the note pattern gets restarted on each beat, effectively rendering it useless.
But if i write:

d1 $ (# note (run 8)) $ euclid 3 8 $ sound "bass"

Here it works, but I'm unsure of the reason. I think I don't get how the "pattern structure comes from the left" rule is applied in this case. Can anyone explain?

I'll have a go!

Now, if I write:
d1 $ euclid 3 8 $ sound "bass" # note (run 8)
Here, the note pattern gets restarted on each beat, effectively rendering it useless.

I think the trick to highlight the issue, is to take the euclid function away, ie:

d1 $ sound "bass" # note (run 8)

Will only play the first note of run on each cycle, since the pattern is coming from sound "bass" (played once each cycle) effectively rendering the # note (run 8) useless in this context as well.

Then applying the euclid 3 8 pattern, only patterns the single note sound.

But if i write:
d1 $ (# note (run 8)) $ euclid 3 8 $ sound "bass"
Here it works, but I'm unsure of the reason. I think I don't get how the "pattern structure comes from the left" rule is applied in this case.

You've got a pattern of notes in this case - which starts as:
0 1 2 3 4 5 6 7 8
Is changed by euclid function to something like:
0 3 6
and then that pattern (and note value/pitch) is applied to the sound "bass"

I'm unsure if that's going to clear anything up - but I hope it helps in some way :slight_smile:

3 Likes

Thanks, your answer helps a lot! So if I understand correctly, flipping sound "bass" and note (run 8) should make it work.

d1 $ euclid 3 8 $ note (run 8) # sound "bass" -- should be the same as
d2 $ sound "bass(3,8)" # note (run 8) -- this

But it is not. Here, on each beat of the euclidean rythm, the whole note (run 8) is squeezed inside 1/8th of a cycle. :confused:

I thought it would go like this:

1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 -- euclid
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 -- note (run 8)
-----------------------------
0 | x | x | 3 | x | x | 6 | x

I can't test at the moment, but have a suggestion since I've been playing with this kind of note masking recently -- struct might help to achieve what you outline on your diagram:

d1 $ struct "t(3,8)" $ note (run 8) # sound "bass"

The t in struct stands for true; with this you can "pick" notes from a pattern using an euclidean rhythm, or any other sequence.

Does this help?

1 Like

That's interesting, I didn't know about struct!

My goal is to define the rythm structure with a function, as euclid's parameters come from an external controler - so your suggestion won't do it for me. But it led me to this:

d1 $ struct (euclidOffBool 3 8 0 "t") $ note (run 8) # sound "bass"

Well, euclidOffBool is not documented so it looks like it's working but I'm not absolutely sure it will always be the case.

Alright, got an answer from the toplap chat - putting it there for the sake of completeness.

d1 $ (euclid 3 8 $ sound "bass") # note (run 8)

by adding the parentheses, I'm applying euclid 3 8 to sound "bass" only, and only then do I combine it with note (run 8). So simple ...

3 Likes