Beat Slicing in FoxDot

Is there a way of doing beat slicing within FoxDot. I have had a look through the various commands but I can’t see an obvious way of doing it.

Essentially I want to be able to play a portion of a sample and at any point within a bar

Thanks

You can use the loop synth. So it would look something like:

p1 >> loop("path/to/my/sample", [0, 1, 2, 3])

That plays the first 4 beats of the file but you can supply different values for starting positions. If you know the bpm of the sample you can supply a tempo keyword to automatically change the play back speed to fit with the current tempo. Hope that helps!

Thanks for that

Is there a way of playing only part of the sample and position this within a bar. So for example
p1 >> loop("path/to/my/sample", [~, 1, ~, ~])
where ~ is a rest

I guess where I would like to ultimately get to is to have the ability to define :-

  • a point in a sample (say as a number between 0 and 1)
  • how long to play as a fraction of the bar length and
  • it’s offset from the start of the bar

Thanks

Unfortunately Python uses ~ as a special character but there’s potential to use _ perhaps. You can use the dur keyword to specify durations and delay to offest the start of the sound. From experience most people tend to use more specific times to specify the start point but if you know the value in seconds you can do something like this:

p1 >> loop("path/to/sample", Clock.seconds_to_beats(1), dur=4, delay=1/2)

This will play 4 “beats” of audio starting 1 second into the file and half a beat into the bar. If you want to play a specific duration, you can use sus = Clock.seconds_to_beats(2), which, in this case, would play 2 seconds of audio.

Also, to save some typing you could do something like:

seconds = Clock.seconds_to_beats
p1 >> loop("path/to/sample", seconds(1), dur=4, delay=1/2, sus=seconds(2))

Thanks for that, this gives me just what I was looking for