Transpose sliced pattern


Is it possible to transpose bits of sliced sample?

For example, with this pattern:

d1 $ loopAt 16 $ struct "t*4" $ slice 4 "0..3" $ sound "gordon:1" # up "0 6 2 5"

I'd like that the the first bit is played normally, then the other ones transposed up the given value.

Using up like this doesn't work, is there a way to achieve it?

Thank you

Hi @delaudio

First I simplify by removing the struct which I don't think is doing anything here:

d1 $ loopAt 16 $ slice 4 "0..3" $ sound "gordon:1" # up "0 6 2 5"

Everything to the right of a $ is calculated first. so sound "gordon:1" # up "0 6 2 5" will be calculated before the rest. So you are applying the up to the sound before it gets chopped.

You can use parenthesis with () to make sure the chopping happens first:

d1 $ (loopAt 16 $ slice 4 "0..3" $ sound "gordon:1") # up "0 6 2 5"

However I think this won't work well because pitching up sounds with up (which is an alias for note) also changes the duration of a sound.

Thank you,

yes, the struct can be avoided, however I've already tried the parenthesis and apply up, but I can't hear any difference in sound.
Differently, with speed, it changes pitch, but duration too, and it doesn't work well.
Would be great to stretch, chop and transpose the bits like I do with Ableton, but in a quicker way.


I made it using speed with power function

For example, this was I can use a sound in a 16 bars sample and pitch it to create harmonic variations.
It's not the most readable, but it works :grinning_face_with_smiling_eyes:

  $ loopAt 16 $ struct "[[t ~ ~ t][~ t ~ t]]*32" 
  $ slice (128+64) "0" $ sound "gordon:3" 
  # loopAt 1 (speed $ fast 4 (fastcat [(2 ** (0 / 12)), (2 ** (6 / 12)), (2 ** (2 / 12)), (2 ** (5 / 12))])) 
  # legato 1

Coincidentally I was exploring similar stuff this morning - the part you're doing specifically is covered at the very start - I used chop, which makes me wonder if the function of slice to specifically pitch accurately (as opposed to splice) might be causing some of your issues?

Thank you @cleary . I found the issue. It's not related to slice, but to loopAt.
In fact, I don't need to stretch the sample to fit in the given tempo, since I'm rearraning the bits, I just need to know the correct position of bit in the sample, so I can use up regularly and avoid the speed math.
I found useful creating drum kits in a single merged sample instead of multiple hits, and this way I have the possibility to pitch them up, down as I want. Great!

1 Like