Week 3 lesson 3 - slice and splice

Continuing on from Week 3 lesson 2 - cut vs legato ..

Lets look at a way of 'beat slicing' looping samples, using slice and splice:

setcps 0.6

-- Hear it straight
d1 $ splice 8 "0 1 2 3 4 5 6 7" $ sound "break:4"

-- Now with a more messed-up pattern
d1 $ splice 8 "6 1 [2 3] ~ 4 1 6*2 7" $ sound "break:4"

-- Try changing the cps to hear it at different speeds

-- Try manipulating the pattern of slices
d1 $ splice 8 (fast "1 [0.5 0.75]" "6 1 [2 3] ~ 4 1 6*2 7")
   $ sound "break:4"

-- Now try all the above with 'slice' instead of 'splice'.
-- Slice _doesn't_ do the pitching up/down thing to splice the
-- sound to the step.

-- Here I put six slices from a loop originally in 4/4, to create
-- a 3/4 waltz
d1 $ splice 8 ("0 1 2 3 4 5") $ sound "break:4" # gain 1.1
d2 $ sound "kick snare*2 clap:4" # speed 2

Next lesson:

13 Likes

Didn't tried out much with drum loops before, but splice and slice are great. Slice seems to be my favorite of both.

Thought I could easely extend your example with a variation of a second group of eight slices, but it doesn't come out what I thought.

setcps 0.4

d1 $ slice 8 (slow "1" "1 2 [3 4] ~ 3 6 7 8") $ sound "break:8"

d2 $ slice 16 (slow "2" "1 2 [3 4] ~ 3 6 7 8" + "1 2 [3 4] ~ 3 6 5 8") $ sound "break:8"

Yes that will add the numbers together, rather than have one play after the other.

Here's a couple of approaches:

d2 $ slice 16 (slowcat ["1 2 [3 4] ~ 3 6 7 8", "1 2 [3 4] ~ 3 6 5 8"]) $ sound "break:8"
d2 $ slice 16 (slow 2 "1 2 [3 4] ~ 3 6 7 8 1 2 [3 4] ~ 3 6 5 8") $ sound "break:8"
d2 $ slice 16 ("<[1 2 [3 4] ~ 3 6 7 8] [1 2 [3 4] ~ 3 6 5 8]>") $ sound "break:8"

They should do the same (in haste, I haven't tested them).

Note that it starts counting at 0, so if you have 8 slices, 0 will be the first slice, 1 will be the second one, and 8 will also be the first (because it loops back to the start).

2 Likes

Thanks a lot for this examples! Its almost what I intended.
And now I got, that the slice parameter should remain on "8". That's it:

d1 $ slice 8 (slowcat ["1 2 [3 4] ~ 3 6 7 8", "1 2 [3 4] ~ 3 6 5 8"]) $ sound "break:8"

d1 $ slice 8 (slow 2 "1 2 [3 4] ~ 3 6 7 8 1 2 [3 4] ~ 3 6 5 8") $ sound "break:8"

d1 $ slice 8 ("<[1 2 [3 4] ~ 3 6 7 8] [1 2 [3 4] ~ 3 6 5 8]>") $ sound "break:8"

Great!

I would still substract 1 from all the numbers, i.e. this might sound better (or might not):

d1 $ slice 8 (slowcat ["0 1 [2 3] ~ 2 5 6 7", "0 1 [2 3] ~ 2 5 4 7"]) $ sound "break:8"

So the first slice 0 is at the start.

Also I noticed that there is just one number changing, so you could also write this like:

d1 $ slice 8 "0 1 [2 3] ~ 2 5 <6 4> 7" $ sound "break:8"
4 Likes

Yes! Mini-notation.

I love these (still catching up a bit from starting late). Pushing the splices into audio rate gets really interesting:

d1 $ slice 8 (slow 1 "0*5 1*7 [2*4 3*8] ~ 4*7 1*16 6*8 7*37") $ s "break:4"  # delay 1 # room
5 Likes

sort of wavetable synthesis?

1 Like

@mattia.paterna yes, i think, in a more limited way than typical. i'd be limiting how it's read to discrete blocks of samples instead of reindexing more arbitrarily.

1 Like

Hi!!
I'm trying to slice a long sample, but just from the second middle of that. How can I pattern just the second half of a long sample to manipulate it? Taking "bev" as example, imagin it begins playing normal, but in the middle it begins to change using stut, |*speed or whatever.
It's close to work with a sample like "break" and that sintax

d1 
    $ within (0.5, 1) (stut' 16 (0.0625)((|*speed 1.3))) 
    $ within (0.5, 1) (#gain 0)
    $ splice 32 "[0 .. 32]"
    $ sound "break:4" 
    # speed 1

But with a sample as long as "bev" it fails.

d1 
    $ slow 4
    $ within (0.5, 1) (stut' 16 (0.0625)((|*speed 1.3))) 
    $ within (0.5, 1) (#gain 0)
    $ splice 32 "[0 .. 32]"
    $ sound "bev" 
    # speed 1

How could I achieve this?

3 Likes

That first example sounds nice!

I'm a bit confused what the within (0.5, 1) (#gain 0) is doing. I can hear it sounds very different without it.. But don't understand why the first half of each cycle isn't completel silent then..

The problem with the second one is it lasts longer than a cycle, and transformations generally work on a per-cycle basis. You have a slow 4 there but that ends up stretching out all the chopped up bits or grains leaving gaps. So maybe you also want to modify the playback rate of the sound. You could do that with 'hurry' instead:

d1 
    $ hurry 0.25
    $ within (0.5, 1) (stut' 16 (0.0625)((|*speed 1.3))) 
    $ within (0.5, 1) (#gain 0)
    $ splice 32 "[0 .. 32]"
    $ sound "bev" 

Maybe it's better after the splice though:

d1 
    $ within (0.5, 1) (stut' 16 (0.0625)((|*speed 1.3))) 
    $ within (0.5, 1) (#gain 0)
    $ hurry 0.25
    $ splice 32 "[0 .. 32]"
    $ sound "bev" 
1 Like

Hi @yaxu thanks for your answer. I think what I'm actually searching for is a sintax capable to affect a long sample progessively while it sounds. May be the way to achieve this is through a sintax capable of slice a long sample in two half, and then reslice the second half in n parts being able to affect its parameters (just for that 2nd half). In that hypotetical case we cought be able to nest it again and again. The result is a long sample who is progressively modificated in some their parameters.
I don't know if it's possible.
Thank you!!

Hi @nuntxaku,

Hm, I don't think there is an easy function for this. I could try to make something but actually in the next version of Tidal and SuperDirt it will become possible to modify effects (e.g. panning, distortion) to an ongoing sound without chopping it. There are some complications but hopefully I will get a chance to finish the interface for this soon.

4 Likes

We'll be waiting for it. Thank you very much!