The Best Beat Slicer is Free

The world’s most powerful and flexible beat slicer is free (as in beer). That’s the good news. The bad news is that there’s math involved. (I’ve created a cheapo little utility to help with the math part but more on that later.)

Filtered and Sliced

[ listen ]
[ download ]

With the latest release of the free VSTi soundfont player plug-in rgc:audio‘s sfz, you can now create your own “soundfonts” based on any sample(s) just by using a simple text file. Your write this text file in any text editor (like Notepad) and instead of loading an SF2 soundfont you tell sfz to load this text file. The format of the text (called “sfzFormat”) was invented by rgc:audio but they opened the format to the public presumably to encourage tools vendors to target it. Click on Vincent to hear something I threw together using sfz as a beat slicer. The first two bars are a drum loop I found. That’s followed by my slicing. No other plug-in effects we used to make this example. (Later in the example I used another stock loop to anchor the beat.)

It should be noted that the example I created was a heavy beat with scratching throughout however sfz, especially with sfzFormat files, can be used to sample or generate just about any sound known and yet to be known to humankind. By far the biggest limitation in this tool is your imagination.

The format is starting to catch on with authors who are rushing to map their favorite soundfonts and sample libraries to the new format. (Peter L. Jones has created an sfzFormat file for the ns_kit7. This file per se doesn’t have a lot to offer over the vanilla ns_kit soundfont but applying techniques specified below will open up a whole world that the SF2 soundfont file format just can’t handle.)

The sfzFormat is extremely flexible. You start by specifying a sample in either uncompressed WAV or OGG. Then there a two major groups of settings: when your sample is played and how to play it.

A sample can triggered:

  • MIDI Key – You can assign a sample to any MIDI key range.
  • Velocity – You can have different samples play depending on how hard you hit the keys.
  • Envelope – A different sample can be triggered on attack and release.
  • MIDI Controller – Samples can be triggered by any controller value (including aftertouch, pitchbend, etc.)
  • Host BPM – That’s right, a different sample can be triggered based on the tempo of your project.
  • Internal Sequence – You can determine the order of samples triggered for a key. In other words, you can set it up so that if you hit the same key four times, a different sample with play each time and then it will cycle again the next four times.
  • Lots of other stuff… – There’s lots more options but you get the idea….

The text format couldn’t be simpler. Here’s the entire file for a soundfont that plays two trumpet samples, one for harder velocity the other for softer:

<region> sample=soft_trumpet.wav lovel=0 hivel=80
<region> sample=hard_trumpet.wav lovel=81 hivel=127

Once the sample is triggered you have an amazing amount of control over the sound. You have total control over looping, including setting loop points. You can crossfade several samples. Envelopes? LFO’s? Lots of them for pitch, amplitude and a host of filters.

For the purposes of beat-slicing the most relevant performance parameters are the “offset” and “end” opcodes. It tells the sfz playback engine to only play a section of the sample when the key is pressed.

<region> sample=dd.wav key=60 offset=31965 end=42619

(The “key” parameter assigns this section to the MIDI key C4 whose value is ’60’.)

That means you can use one loop file, slice it into four parts and assign each part to a different MIDI keyboard simply by moving the offset/end parameters:

<region> sample=dd.wav key=60 offset=0 end=10654 
<region> sample=dd.wav key=61 offset=10655 end=21309 
<region> sample=dd.wav key=62 offset=21310 end=31964 

<region> sample=dd.wav key=63 offset=31965 end=42619 

Now this is all well and good but how are we supposed to physically calculate the subdivisions of a loop file that has millions of samples in it?

That’s why I created this simple little JavaScript utility that will calculate the slices and generate the corresponding sfzFormat opcode for slicing a file. You have to know the BPM and number of beats in the loop file (this information is shown to you in the explorer view of ACID or Live) and then it does the arithmetic of “slicing” the file.

Now I realize there is nothing but limitations in this method (e.g. all the slices are completely even, there is no accounting for non-zero crossings, etc.) and up until this point it’s hardly worth it to jump through these hoops when any number of GUI/WYSIWYG options are out there. But there are two things to keep in mind:

  1. You get a huge array of possible playback options on each slice
  2. Did I mention this whole thing is free?

Once my little utility generates the vanilla slices, that’s when the fun begins. You can apply any set of the myriad of performance parameters opcodes I mentioned above to any individual slice.

After just an afternoon of futzing around with some opcodes and a drum loop I figured out how to add an LFO filter to the bass drum to give it that ‘electro-boingy’ feel:

<region> sample=dd.wav lokey=60 hikey=60 
         pitch_keycenter=60 offset=0 end=10654 
    fillfo_freq=1 
    fillfo_depth=2400 
    cutoff=70 
    resonance=20

The really fun part was adding a filter to the snare slice that was controlled by a MIDI controller. I then recorded myself twiddling the controller on my keyboard against the beat. Here’s what opcodes looked like:

<region> sample=dd.wav lokey=63 hikey=63 
  pitch_keycenter=63 offset=31965 end=42619 
    fillfo_freq=10 
    cutoff=1200 
    resonance=20 
    fillfo_depthcc1=1000
    volume=2 // boost the vol to make up for filtering
    pan=-20 // pan for stereo

Using sfz in FL Studio (Fruity Loops)

I created the example above in FL Studio but there’s no reason why you couldn’t do in ACID or any other VSTi host on Windows.

For the FL Studio version however there is a anomaly of FL that you have to content with: FL will only forward MIDI note input to the sfz channel by default. This means you need setup a “dashboard” to route the CC controller values. Luckily scuzphut has created a Dashboard that makes it trivial to make this happen (see the kvr-vst thread for origin and usage details.)

All the files used in this entry can be downloaded as a ZIP file from here (178kb). Contents include:

  • Example sfzFormat files
  • Pre-sliced drum loop (WAV)
  • Javascript beat slicer calculator
  • FL Studio project
  • FL Dashboard file

Happy slicing.

3 thoughts on “The Best Beat Slicer is Free

  1. Will

    Awesome article !
    Think this may be a little to complex for the average user to catch onto. I do however think that for the advanced user looking for a freeware alternative, this is an impressive article :D

Comments are closed.