envL, shapes, etc?

I just discovered envL, as in: (trigger 1 $ range 0 100 $ slow 64 $ envL)
which is really cool.

I can't find much documentation on it. I'm guessing it stands for 'linear envelope'.
Are there more shapes like like it?

1 Like

out of curiosity, what function are you passing this to that takes 100 as the upper limit?

these are the only other shapes i've encountered in the docs...



It was the waveloss effect.


nice! i use coarse a bunch. especially on hi-hats, adds some nice movement...

oh wow. didn't know about that one. nice!

regarding oscillators in general, i see a lot of examples where we are adding and multiplying other values on top. would love kind of a rudimentary explanation of what is actually happening here...like what does it mean to multiply a saw wave by 4 or add 0.5 to a sine?

d1 $ s "arpy*32" # cutoff (perlinWith (saw * 4) * 2000)

d1 $ s "bd*32" # speed (perlin2 (sine*4) + 1)

Multiplying and adding are doing the same thing as range - they change the amplitude and offset of the oscillators.

Since oscillators go from 0-1 then multiplying by two is doubling the amplitude, so the range would would then go from 0-2. Adding will add an offset, so adding 0.5 will make the oscillator go from 0.5-1.5.


@ben did you check this?

If you just call it


it gives you back ~0>1~|0.5.
Of course the function output continuous values, therefore you need to sample it.
Pay attention to this:

fast 2 $ segment 8 $ envL

This gives you back interpolated values in the first half and 1 for the second. It acts as sort of an envelope that you have to re-trigger every time (and probably this is explaining the trigger 1 at the beginning).

envR happens to be the reversed sibling.

Really cool, thanks for sharing it!

ok interesting. i will have to play around with some patterns to see if i can hear the difference. thanks!

Following in the documentation:
(end of section Elemental patterns)


Yes, I did evaluate it and found the static 0.5. The way I was using the function though it was being sampled once per event, which is also a cool effect (and especially with slow 64 the changes are so small that they almost appear continuous).

Cool that you found some more in the docs! I can't find where you're referencing though.
Here? https://tidalcycles.org/index.php/Category:Elemental_patterns

That is because I am looking at the documentation in hackage. It is rougher, but it sheds a lot of light especially on the internal functions.

This is where I peek and try to understand better what's going on - with few success so far :upside_down_face:

1 Like

Thanks @mattia.paterna. Hackage seems helpful.

I'm a little confused as to how to think about Hackage. i.e. why it exists vs the tidal site (and mostly why it's different). Do different people update the different sites? Is one more complete, or does some info show up exclusively on the tidal site as well? Just trying to wrap my head around everything, as always :wink:

because welcome to the tidal universe where a really clutch piece of info lives in a reply to a comment on a chat forum which vaguely references a github issue brought about by a blogpost which was a response to a livestream that's now deleted.


It exists because Hackage is the repository for all the Haskell packages (think of npmjs.com).

The documentation that is rendered in the browser is nothing else but the comments in the code itself - if you click on #source next to the function names it will bring you to the source code and there you will see the same things + the code.

I don't think either one is fully complete, I think for reference Tidal website is the most comprehensive.

1 Like

Exactly the info I needed, thank you.
And really useful to know about.

1 Like

i don't normally do this style of music but my experiments with the oscillator transformations above got me inspired to do a bit of Powell/Diagonal-influenced techno :robot:

d1 $ stack [ layer [(0.0125 <~).(# pan (slow 12 $ sine + 0.5)), ((# pan (slow 12 $ sine * 4)))] $ s "click*16" # legato 1 # speed (range 0.99 1.33 $ slow 12 envL) , repeatCycles 4 $ struct (binaryN 16 55055) $ s "<bd clubkick>" # gain "<1.33 0.91>" # speed "<1 0.88>" , repeatCycles 4 $ trunc (0.55) $ struct ((inv)(binaryN 16 55055)) $ s "cp" # speed "<0.66 0.88>" , (0.122 <~) $ repeatCycles 16 $ struct "<t*4 f>" $ s "linnhats" # coarse 3 , repeatCycles 8 $ (0.111 <~) $ struct "t(3,8,2)" $ note "<ef2 e2>" # s "monsterb" # legato 0.66 # waveloss 33 , repeatCycles 24 $ off "0.0125 0.00625" (# speed (range 0.97 1.11 $ slow 12 sine)) $ struct "t(4,10)" $ note "[g6 g7]" # s "moog" # legato (range 0.11 0.33 $ slow 36 sine) # gain 0.79 , slow 24 $ n (run 16) # s "diphone" # legato 1 # waveloss 22 # speed 0.88 # gain 1.22 ]


Dig it. And that's some dense code :wink: