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

Posted on Leave a comment

Sample Creators: New Feature in Version 1.15.2: Pluck Oscillator

Version 1.15.2 of DecentSampler introduces a cool new oscillator type that brings physical modeling synthesis capabilities to the platform: the pluck oscillator. This new waveform uses the Karplus-Strong algorithm to simulate the sound of plucked strings, adding a powerful new tool for creating realistic and expressive string instruments without requiring any audio samples. The pluck oscillator has also been open-sourced under the MIT license here.

What is the Pluck Oscillator?

The pluck oscillator implements the classic Karplus-Strong algorithm, a physical modeling technique that simulates the behavior of a vibrating string. When you trigger a note, the oscillator generates a burst of noise (the “pluck” or excitation) which is then fed through a delay line with feedback. As the sound circulates through the delay, it gradually loses high frequencies, creating the characteristic warm, decaying tone of a plucked string.

Using the Pluck Oscillator

Using the pluck oscillator is straightforward. Simply set the waveform attribute to "pluck1" on either an <oscillator> element or its parent <group>:

<DecentSampler minVersion="1.15.1">
  <groups attack="0.005" decay="0.1" sustain="1" release="10.0">
    <group>
      <oscillator waveform="pluck1" damping="0.5" pluckType="0.5"/>
    </group>
  </groups>
</DecentSampler>Code language: HTML, XML (xml)

As you can see, the oscillator has two new parameters The pluck oscillator responds to standard ADSR envelope parameters, but the release time is particularly important as it controls how long the string continues to resonate after you release the key.

Controllable Parameters

The pluck oscillator exposes two key parameters that can be controlled via bindings:

Damping (OSCILLATOR_DAMPING)

The damping parameter controls how quickly high frequencies decay from the sound. This simulates the effect of damping on a real string:

  • Lower values (0.0 – 0.3): Very bright sound with slow decay, like a lightly-touched string
  • Medium values (0.3 – 0.7): Balanced tone with natural decay
  • Higher values (0.7 – 1.0): Darker, heavily damped sound that dies out quickly

You can bind damping to a knob like this:

<labeled-knob x="20" y="20" width="80" height="100" label="Damping" 
              value="0.5" minimum="0" maximum="1">
  <binding type="general" level="group" position="0" 
           parameter="OSCILLATOR_DAMPING" 
           translation="linear" 
           translationOutputMin="0" 
           translationOutputMax="1"/>
</labeled-knob>Code language: HTML, XML (xml)

A useful technique is to also map damping to the release time, so that heavily damped sounds die out faster:

<binding type="amp" level="group" position="0" 
         parameter="ENV_RELEASE" 
         translation="table"
         translationTable="0,0.5;0.5,6.0;1.0,10.0"/>Code language: HTML, XML (xml)

Pluck Type (OSCILLATOR_PLUCK_TYPE)

The pluck type parameter controls the excitation signal—the initial “burst” that triggers the string vibration:

  • Value 0.0: Pure triangle wave excitation, producing a softer, more rounded tone
  • Value 0.5: Blend of triangle and noise
  • Value 1.0: Pure white noise excitation, producing a brighter, more percussive attack
<labeled-knob x="120" y="20" width="80" height="100" label="Pluck Type" 
              value="0.5" minimum="0" maximum="1">
  <binding type="general" level="group" position="0" 
           parameter="OSCILLATOR_PLUCK_TYPE" 
           translation="linear" 
           translationOutputMin="0" 
           translationOutputMax="1"/>
</labeled-knob>Code language: HTML, XML (xml)

Creative Applications

The pluck oscillator opens up many creative possibilities:

String Instruments: Create harps, guitars, basses, and other plucked instruments with just a few lines of XML. The physical modeling approach means the sound will respond naturally to different playing dynamics.

Hybrid Sounds: Layer the pluck oscillator with acoustic samples to add extra body and sustain to string sounds, or use it as a sub layer for bass guitars.

Experimental Textures: Push the damping and pluck type parameters to extremes to create otherworldly metallic tones, percussive hits, or evolving pads.

Complete Example

Here’s a complete preset that demonstrates both controllable parameters:

<?xml version="1.0" encoding="UTF-8"?>
<DecentSampler minVersion="1.15.1">

  <ui height="375">
    <tab>
      <labeled-knob x="20" y="20" width="80" height="100" 
                    label="Damping" value="0.5" 
                    minimum="0" maximum="1">
        <binding type="general" level="group" position="0" 
                 parameter="OSCILLATOR_DAMPING" 
                 translation="linear" 
                 translationOutputMin="0" 
                 translationOutputMax="1"/>
        <!-- Also control release time -->
        <binding type="amp" level="group" position="0" 
                 parameter="ENV_RELEASE" 
                 translation="table"
                 translationTable="0,0.5;0.5,6.0;1.0,10.0"/>
      </labeled-knob>

      <labeled-knob x="120" y="20" width="80" height="100" 
                    label="Pluck Type" value="0.5" 
                    minimum="0" maximum="1">
        <binding type="general" level="group" position="0" 
                 parameter="OSCILLATOR_PLUCK_TYPE" 
                 translation="linear" 
                 translationOutputMin="0" 
                 translationOutputMax="1"/>
      </labeled-knob>

      <label x="20" y="130" width="300" height="20" 
             text="Pluck Oscillator Example" fontSize="16"/>
      <label x="20" y="155" width="300" height="40" 
             text="Use Damping knob to control decay time&#10;Use Pluck Type knob to blend excitation (triangle → noise)" 
             fontSize="11"/>
    </tab>
  </ui>

  <groups attack="0.005" decay="0.1" sustain="1" release="10.0" 
          ampVelTrack="1" pitchKeyTrack="1">
    <group damping="0.5" pluckType="0.5">
      <oscillator waveform="pluck1" />
    </group>
  </groups>

</DecentSampler>Code language: HTML, XML (xml)

Getting Started

To use the pluck oscillator, make sure your preset specifies minVersion="1.15.2":

<DecentSampler minVersion="1.15.2">
  <!-- Your preset content -->
</DecentSampler>Code language: HTML, XML (xml)

A complete working example can be found in the DecentSampler Sample Library Examples repository here.

The pluck oscillator is documented in the DecentSampler Developer’s Guide, along with all the other oscillator types and parameters.

I’m really excited to see what creative uses the community comes up with for this new physical modeling capability. As always, if you find bugs, make sure to report them here. I do read all of the emails, even if I don’t always have time to respond to them. 🙂

Have fun!

– Dave