Posted on Leave a comment

Sample Creators: A New Wavetable Engine

With the release of version 1.20.0, Decent Sampler now has a wavetable engine.

Wavetables are a powerful synthesis technique that allows you to create complex, evolving timbres by scanning through a series of single-cycle waveforms (called “frames”) stored in a file. Each frame can be a different shape, and as you move through the wavetable, the oscillator crossfades between adjacent frames to create smooth transitions. This allows for a huge variety of sounds, from classic analog-style waveforms to rich, evolving textures that would be difficult or impossible to achieve with traditional oscillator types.

The syntax for using it is very similar to other oscillator engines:

<DecentSampler minVersion="1.20.1">
  <groups attack="0.01" decay="0.1" sustain="1.0" release="0.5">
    <group >
      <oscillator waveform="wavetable" wavetableFile="Wavetables/Default Shapes.wav" wavetableFrameInterpolation="false" wavetablePosition="0.0"/>
    </group>
  </groups>
</DecentSampler>
Code language: HTML, XML (xml)

Right now, it supports just four parameters:

  • waveform: Must be set to wavetable to use the wavetable engine
  • wavetableFile: The path of the wavetable file to use
  • wavetablePosition: A number from 0 to 1 that determines which frame of the wavetable to use
  • wavetableFrameInterpolation: A boolean that controls whether adjacent wavetable frames are linearly crossfaded (true) or snapped to the nearest frame with no crossfading (false)

The wavetablePosition parameter can be modulated in real time using the OSCILLATOR_WAVETABLE_POSITION binding parameter, and the wavetableFrameInterpolation can be toggled on and off using the OSCILLATOR_WAVETABLE_FRAME_INTERPOLATION binding parameter. If you are going to use knobs to change these parameters, make sure to define them at the group level, not the oscillator level, since the bindings are at the group level. Here’s a simple example of how to set up a knob to control the wavetable position:

<?xml version="1.0" encoding="UTF-8"?>
<DecentSampler minVersion="1.19.0">
  <ui height="375" bgColor="#FF1A1A2E" >
    <tab>
      <labeled-knob x="380" y="55" width="80" height="85" label="Position" value="0" minValue="0" maxValue="1" textColor="#FFFFFFFF" trackForegroundColor="#FF6699FF" trackBackgroundColor="#FF333355">
        <binding type="general" level="group" tags="wt" parameter="OSCILLATOR_WAVETABLE_POSITION" translation="linear" translationOutputMin="0.0" translationOutputMax="1.0"/>
      </labeled-knob>
    </tab>
  </ui>
  <groups attack="0.02" decay="0.1" sustain="1.0" release="0.5" >
    <group tags="wt" wavetablePosition="0.0" enabled="1"  modVolume="0.9999999776482582">
      <oscillator waveform="wavetable" wavetableFile="Wavetables/Default Shapes.wav" wavetableFrameInterpolation="true"/>
    </group>
  </groups>
</DecentSampler>Code language: HTML, XML (xml)

As mentioned above, the wavetable file format Decent Sampler uses is based on the Serum-compatible format, which is a standard RIFF-based format with a .wav extension. You can create these files using tools like Serum, Vital, or Carvetoy. The file contains multiple “frames” of audio data, which the oscillator can crossfade between to create evolving timbres. When you load a wavetable file, Decent Sampler reads the number of frames and their size, and uses that information to determine how to map the wavetablePosition parameter to the appropriate frames in the file.

For more detailed information on how to use the wavetable engine, check out the updated documentation in the Decent Sampler Developer’s Guide. There are also two example presets included in the DecentSampler Sample Library Examples (look in the example-017-oscillators directory).

I’m really looking forward to seeing what you all create with this new feature! Wavetables open up a whole new world of sonic possibilities, and I can’t wait to hear the weird and beautiful sounds that come out of it. Happy sampling!

– Dave