Week 4 lesson 1 - continuous patterns - sine, square, tri, saw and random functions

Will deal with iter and friends properly soon but iter 4 will shift time by one quarter every cycle. You can use it with any pattern.

1 Like

Spicy! And thanks for the other response too.

Hi Alex :wink: Thanks a lot for this tutorial! I have a question regarding these two lines of code:

d1 $ speed (segment 32 $ range 0.5 2.5 sine) # sound "bd"

and this

d1 $ sound "bd" # speed (range 0.5 1.5 sine)

I can't understand the difference in the execution. That is, I take the structure from the left side, but why is the operation sounds the same?

Many thanks :wink:

Hi, they shouldn't sound the same, the first one will have 32 events per cycle, and the second only one.

It's not until you have 32 'bd' kicks in the second example that they sound the same:

d1 $ sound "bd*32" # speed (range 0.5 2.5 sine)

I also needed to adjust the range of the sine.

Thanks;) regarding the position of the speed settings, does it change anything? I mean, put speed after a$(so in the first part) or after the#is important? Sorry for this simple question but I'm struggling a bit in here

First of all, a simple example

d1 $ sound "bd" # speed 2

vs

d1 $ speed 2 # sound "bd"

These have exactly the same result.

This would also be the same, because although 'speed' is given twice, when you use #, the value is taken from the right.

d1 $ speed 5 # sound "bd" # speed 2

The next one would also be the same. There are two events on the right, but with #, the rhythm comes from the bd on the left. That bd starts at the start of the cycle, when the 2 of speed is active, so you end up with a single bd with a speed of 2.

d1 $ sound "bd" # speed "2 5"

The $ does something quite different from #. The # is combining the sound "bd" and speed "2" patterns into a single pattern. The $ is just there to make sure everything it 'worked out' on its right, before being passed to d1 to be sent to superdirt.

I talk about combining patterns with # and friends here:

and I talk about $ here:

Does that help @antonelse?

2 Likes

SUPER clear Alex :wink: thanks a lot for the effort !! :slight_smile:

1 Like

Wow, this can get really fun (and crazy!)...

d1 $ speed (segment "128 64 256 16" $ range 0.5 "<64 128 16 32>" sine) # "breaks125" # legato 1 # pan (fast 4 (sine))
6 Likes

Hi! Very nice video, full of interesting stuff. I plan to watch the videos from the start soon in order to try and come to terms with what I've already forgotten and what I missed. My issues are generally related to combining elements and creating variety, for instance having different speeds for different parts of the n pattern, I will post concrete examples in "thoughs on the course".

Here, I tried something which didn't work and I'm wondering how to get it working :

d3 $ speed (struct "t <(3,7) (3,8)>" $ range 0.5 1 sine) #sound "dr:8"

The error comes from putting two euclidean patterns between '<' and '>' and although it didn't seem far fetched as you showed <t f t t f>(3,8) I didn't crack this. Any tip welcome and thanks for all this, a concrete project is starting to form and I'm very excited.

P.S. while watching W4L2 I found this nice solution:
d2 $ fast 2 $ n (struct "t(<2 5>,<9 7>)" $ (irand 24)+ 12) # sound "rash"

Yes the parser isn't clever enough for t<(3,7) (3,8)> but t(3,<7 8>) does indeed work

1 Like

Thanks for the answer.
A new door opens :
d1 $ sound (struct "t(5,8,<0 2>)" $ choose ["bd", "arpy", "kick"])
Could you please elaborate on it?

I tried to simplify the example without choose but I didn't get how to make n patterns with a series of samples which are not in the same folder ( I' suspect I simply haven't memorized this)

d1 $ sound (struct "t(5,8,<3 8>)" $ sound "bd" "arpy" "kick"

P.S. : Eventually tried to use drawLine with little success :

drawLine $ "x(5,8,<3 8>"

Is there any way to create custom wave shapes? Almost like with ADSR types of values?

2 Likes

Is this what you mean?

d1 $ struct "t(5,8,<3 8>)" $ sound "bd arpy kick"

You were just missing a closing bracked here:

drawLine $ "x(5,8,<3 8>)"
3 Likes

Hm you can specify points and then interpolate between with smooth..

E.g. this would be like tri

smooth "0 1"
3 Likes

Ah, that's a neat way to go about it...

d1 $ s "ec*8" # speed (smooth "0 1@5 0.5 0.2")

...has some interesting results

6 Likes

Oh boy! So much fun applying the lessons learned so far.
setcps (75/60/4)

xfadeIn 1 8 $ jux (iter 2) $ loopAt 6 $ chop 1 $ striate 64 $ speed (struct "t(2,7)" $ range 0.7 1 sine) # sound "bev" # gain 0.7 # delay 1 # delaytime 0.675 # delayfb 0.8 # room 0.2

d2 $ juxBy 0 (iter 4) $ rev $ struct "t(5,8)" $ sound "tabla" # n "<21 24> <16 6> <4 12>" # gain 0.8

1 Like

Is defining struct inside n any different than having it defined before, e.g. d2 $ fast 2 $ struct "t(<2 5>,<9 7>)" $ n ((+ 12) $ irand 24) # sound "rash"? Asking because I can't understand completely.

2 Likes

In this case I think it's exactly the same result. It changes the order in which things are done, i.e. in the your version the 'n' and 'rash' patterns are combined before the 'struct' is applied.. But in this case that doesn't make any difference.

1 Like

Is there a way to change the waveform starting point (with off maybe ?)?

Totally unrelated but could you explain what does the @ do ?

1 Like

Yes you can do that with the <~ or ~> operator e.g. (0.1 <~ sine)

Or the rotL or rotR functions which do the same e.g. (rotL 0.1 sine)

These functions are nice for time shifting in general, I'll do a lesson on that soon.

@ sets the relative 'size' of a step in the mininotation. So in "a@2 b@0.5", 'a' would be four times the length of 'b'.

4 Likes