Week 1 lesson 4 - mini-notation part 2

I have a pattern that I am trying to conditionally apply an effect chain to. This is where I am at:

d2 $ slow 2
   $ always (# crush (range 3 16 $ rand))
   $ sometimes (# delay 0.5 # delaytime 0.05)
   $ s "~ ~ numbers ~ " 

But applying the delay parameters does not work like this. How is this achievable?

When you combine two "synth" patterns together like delay and delaytime in a condition, you have to separate them with a . and wrap them each in parenthesis:

d2 $ slow 2
   $ always (# crush (range 3 16 $ rand))
   $ sometimes ((# delay 0.5) . (# delaytime 0.05))
   $ s "~ ~ numbers ~ " 

I don't know the Haskell/Tidal syntax well enough to explain why you need to do this, but it should work.

2 Likes

Thanks + welcome @kindohm!

That's generally how I do things, but here's another way:

d2 $ slow 2 
   $ always (# crush (range 3 16 $ rand)) 
   $ sometimes (# (delay 0.5 # delaytime 0.05)) $ s "~ ~ numbers ~ "

So (# (delay 0.5 # delaytime 0.05)) works, but (# delay 0.5 # delaytime 0.05) unfortunately doesn't. I'm not 100% sure why the latter doesn't work either. Somehow haskell can't work out which order things are in.

This works too:
(# (delay 0.5 # delaytime 0.05 # delayfb 0.7))

2 Likes

Thanks @kindohm @yaxu

I'm also wondering if there is a way to make a pattern reset

For example: I define a euclidean pattern below that spans a single cycle, but I want the pattern to reset to the first step of the pattern after every n (> 8) steps

d1 $ s "bd(3, 8)"
3 Likes

Fun worksheet. I just recreated the band AC/DC:

d1 $ n "{0 3, 2 2}" # sound "alphabet"

1 Like

d1 $ sound "[kick snare]!3 clap@0.5" doesn't sound anything like the original. A mistake on this solution?

This was solved in the next video for me ... I was on tidal 1.4.3. I guess the @ operator was introduced after that. An upgrade to 1.4.9, and now this solution sounds right!

2 Likes

Ah great that you solved this! Sorry was super busy on other things today

There is an effect suite that implements what you're looking for partially:
https://tidalcycles.org/index.php/All_effects_and_synths#ASR-Envelope

No decay unfortunately :frowning:

@yaxu - I'm definitely missing some samples - specifically hi and lo in the first week's examples. I've downloaded the master set, downloaded the samples-extra, and used the quark. The other sounds are present and play correctly, but those seem to be missing.

Which pack should I expect to find them in and/or where can I download them ?

Oh sorry it seems I messed up and there were a few folders missing from samples-extra.zip.

Please re-download it from here https://slab.org/tmp/samples-extra.zip

Sorry about this!

No problem! I'm glad I wasn't going crazy!
Thanks - everything seems to be working now.

I've been really enjoying this. But I have to say, I find some of your examples disturbing... what you write is not what I hear. For example you had something like
d1 $ sound "clap:4 [lo hi bd sn]/2"
with the clap on the beat, but what I hear is
d1 $ sound "[lo hi bd sn]/2 clap:4"
with the clap on the backbeat. Similarly for lots of snare examples. I believe they're equivalent, but the latter makes more musical sense to me. I guess that's just a cultural thing?

Trying to follow the "rhythmic feet" part, but I'm doing something wrong... this line from the worksheet
d1 $ sound "[bd sd] [mt ht lt] [arpy arpy:4] [snare clap:4 bd]"
works, but the line above
d1 $ sound "bd sd . mt ht lt . arpy arpy:4 . snare clap:4 bd"
gives me an error:
t> Error in pattern: Syntax error in sequence:
"bd sd . mt ht lt . arpy arpy:4 . snare clap:4 bd"
^
unexpected " "
expecting ".."
What am I doing wrong?

(Indentation screwed in Markdown... the caret is below the first dot on the line above.)

Yes a great point! I'd naturally hear it the same as you, with the downbeat (or 'sam') on the lo or bd. I'm comfortable with patterns sounding differently to how they're written though.. The 'truth' being in what you hear, rather than what is written. If you added a kick on top with d2 $ sound "kick" the downbeat would shift to the align with the start of the written form, and the d1 pattern would sound syncopated.. This sudden shift happens to me a lot listening to the intros to tracks as music builds up, and can be a nice feeling.

Anyway that's a digression - a good point, for learning it would be better if the notation matched perception as much as possible! (not in a position to hear it myself at the moment, will try later, maybe we should do a poll..)

1 Like

Ah yes sorry, this is a bug in the latest version of Tidal. I'll look at a release tonight or tomorrow.

Hi!! Maybe it's a silly question, but It works (internaly) same way this

d1 $ s "bd*4"

than this?

d1 . s "bd*4"

You'd need parentheses,

(d1 . s) "bd*4"

but yes, in Haskell they're pretty much the same thing.

BTW the parentheses are necessary because function application (the space between s and "bd*4") has a higher precedence than function composition (.), so your 2nd example gets interpreted as d1 . (s "bd*4"), which throws an error because you can only compose functions with one input and one output and the combo s "bd*4" no longer has any input.

1 Like

I disagree - $ and . work very differently internally and in practice.

$ evaluates the entire expression on its right and passes it as a (single) argument to the function on its left.

. takes the function on its right and composes it together with the function on its left to create a new function.

d1 . s "bd*4"

The above doesn't evaluate because s "bd*4" isn't a function.

(d1 . s) "bd*4"

The above does work - it makes a function that takes a pattern of strings as input, and gives that function a pattern of strings. but then there's no easy way to combine it with any other control patterns, e.g. (d1 . s) "bd*4" # speed 2 won't work. You could do (d1 . (# speed 2) . s) "bd*4" but that's getting messy..

So $ and . are similar in that they join things together, but they join together different types of things.

2 Likes