Posted on 3 Comments

Sample Creators: New Features in Version 1.15.0: Oscillators, Lines, and Rectangles

The Mona Lisa in rectangles.

Version 1.15.0 of DecentSampler introduces three powerful new features that expand what’s possible when creating sample libraries: built-in oscillators for synthesis without samples, line elements for visual design, and rectangle elements for custom UI layouts. These features open up exciting new possibilities for both sound design and visual presentation.

Oscillators

One of the most significant additions in version 1.15.0 is support for built-in oscillators. Previously, DecentSampler was purely sample-based, but now you can create synthetic sounds using waveform generators. This is particularly useful for creating sub-bass layers, lead synth sounds, or even entirely sample-free instruments.

Using oscillators is straightforward. Instead of using <sample> elements, you place an <oscillator/> element inside a <group>. The waveform type is specified using the waveform attribute on either the sample or the parent group. Here’s a simple example:

<DecentSampler minVersion="1.15.0">
  <groups>
    <group>
      <oscillator waveform="sine"/>
    </group>
  </groups>
</DecentSampler>
Code language: HTML, XML (xml)

The available waveform types are:

  • sine – Pure sine wave with no harmonics, ideal for sub-bass
  • saw – Sawtooth wave with rich harmonics, great for bright sounds
  • square – Square wave with odd harmonics, useful for hollow tones
  • triangle – Triangle wave with fewer harmonics, produces mellower tones
  • noise (or white_noise) – White noise generator, useful for percussion and textures

You can combine oscillators with regular samples for layering effects. For example, you might add a sine wave sub-bass underneath acoustic piano samples to add depth and weight to the low end.

Here’s a more complete example showing how to create a simple synth with waveform selection:

<DecentSampler minVersion="1.15.0">
  <ui>
    <tab>
      <menu x="10" y="10" width="150" height="30" value="1">
        <option name="Sine">
          <binding type="general" level="group" position="0" 
                   parameter="OSCILLATOR_WAVEFORM" 
                   translation="fixed_value" translationValue="sine"/>
        </option>
        <option name="Saw">
          <binding type="general" level="group" position="0" 
                   parameter="OSCILLATOR_WAVEFORM" 
                   translation="fixed_value" translationValue="saw"/>
        </option>
        <option name="Square">
          <binding type="general" level="group" position="0" 
                   parameter="OSCILLATOR_WAVEFORM" 
                   translation="fixed_value" translationValue="square"/>
        </option>
        <option name="Triangle">
          <binding type="general" level="group" position="0" 
                   parameter="OSCILLATOR_WAVEFORM" 
                   translation="fixed_value" translationValue="triangle"/>
        </option>
      </menu>
    </tab>
    <keyboard/>
  </ui>
  <groups>
    <group waveform="saw" volume="0.5" attack="0.01" decay="0.3" 
           sustain="0.7" release="0.5">
      <oscillator/>
    </group>
  </groups>
</DecentSampler>
Code language: HTML, XML (xml)

An example of using oscillators can be found in the DecentSampler Sample Library Examples repository here.

Rectangle Elements

Rectangle elements allow you to create custom backgrounds, panels, borders, and decorative elements in your UI. They support fill colors, border colors, and border thickness, giving you fine control over the visual design of your presets.

Adding a rectangle to your UI is simple:

<rectangle x="10" y="20" width="200" height="100" 
           fillColor="#FF3366FF" 
           borderColor="#FF000000" 
           borderThickness="2" />
Code language: HTML, XML (xml)

Colors use the 8-character hex format #AARRGGBB (alpha, red, green, blue), so #FF3366FF is fully opaque blue with a touch of green.

What makes rectangles particularly powerful is that they support bindings. You can dynamically control their position, size, and visibility using knobs, buttons, or other controls. Here’s an example that uses a knob to control a rectangle’s width:

<ui>
  <tab>
    <labeled-knob x="10" y="10" width="90" label="Width" 
                  type="float" minValue="10" maxValue="400" value="100">
      <binding type="control" level="ui" position="1" parameter="WIDTH" 
               translation="linear" translationOutputMin="10" translationOutputMax="400"/>
    </labeled-knob>
    <rectangle x="10" y="100" width="100" height="50" 
               fillColor="#FF0066FF" 
               borderColor="#FF000000" 
               borderThickness="2" />
  </tab>
  <keyboard/>
</ui>
Code language: HTML, XML (xml)

The binding parameters available for rectangles are:

  • X – X position in pixels
  • Y – Y position in pixels
  • WIDTH – Width in pixels
  • HEIGHT – Height in pixels
  • VISIBLE – Visibility (true/false)

These dynamic capabilities open up possibilities for creating animated UI elements, progress bars, visualizations, and more.

Line Elements

Line elements complement rectangles by allowing you to draw lines for dividers, borders, connectors, or decorative elements. Lines are defined by their start and end points:

<line x1="10" y1="20" x2="200" y2="20" 
      lineColor="#FF000000" 
      lineThickness="2" />
Code language: HTML, XML (xml)

Like rectangles, lines also support dynamic control through bindings. You can create interactive visual elements by binding their endpoints to controls:

<ui>
  <tab>
    <labeled-knob x="10" y="10" width="90" label="End X" 
                  type="float" minValue="0" maxValue="400" value="200">
      <binding type="control" level="ui" position="1" parameter="X2" 
               translation="linear" translationOutputMin="0" translationOutputMax="400"/>
    </labeled-knob>
    <line x1="50" y1="100" x2="200" y2="100" 
          lineColor="#FFFF0000" 
          lineThickness="3" />
  </tab>
  <keyboard/>
</ui>
Code language: HTML, XML (xml)

The binding parameters for lines are:

  • X1 – Start X position in pixels
  • Y1 – Start Y position in pixels
  • X2 – End X position in pixels
  • Y2 – End Y position in pixels
  • VISIBLE – Visibility (true/false)

Together, rectangles and lines give you a complete toolkit for creating sophisticated custom UIs. You can build complex layouts, create visual feedback systems, or even make artistic designs entirely from geometric shapes.

Examples of using rectangles and lines can be found in the DecentSampler Sample Library Examples repository here. The examples include demonstrations of static layouts, dynamic binding controls, and even an artistic rendering of the Mona Lisa created entirely with rectangles!

Getting Started

To use any of these new features, make sure your preset specifies minVersion="1.15.0":

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

All of these features are documented in the DecentSampler Developer’s Guide, and complete working examples are available in the DecentSampler Sample Library Examples repository.

Definitely let me know if you run into any issues with these new features. They represent a significant expansion of DecentSampler’s capabilities, and I would love to hear your feedback and see what creative uses you come up with.

All the best,
Dave

Posted on 2 Comments

Sample Creators: New Features: Continuous Background Sounds & Multi-State Controls

Version 1.13.6 of DecentSampler introduces two new features: continuous background sounds and multi-state controls. Continuous background sounds allow sample libraries to incorporate “always-on” sounds, such as vinyl crackle or tape hiss, and multi-state controls allow sample libraries to select between several different values using a standard slider or knob control.

Continuous Background Sounds

Using these is extremely easy. Simply add trigger="continuous" to a sound and it will always play. To turn continuous sounds on and off, simply use the enabled attribute. Here’s an example:

<DecentSampler minVersion="1.13.6">
  <ui>
    <tab>
      <!-- This control adjusts the volume of the hiss sound -->
      <labeled-knob x="200" y="10" width="90" textSize="16" textColor="AA000000" trackForegroundColor="CC000000" trackBackgroundColor="66999999" label="Hiss" type="float" minValue="0.0" maxValue="1.0" value="1">
        <binding type="amp" level="tag" identifier="hiss" parameter="AMP_VOLUME"/>
      </labeled-knob>
      <!-- This control turns the hiss on and off -->
      <button x="200" y="120" width="90" height="20" parameterName="Hiss Enabled">
        <state name="Enabled">
          <binding type="general" level="group" tags="hiss" parameter="ENABLED" translation="fixed_value" translationValue="true" />
        </state>
        <state name="Disabled">
          <binding type="general" level="group" tags="hiss" parameter="ENABLED" translation="fixed_value" translationValue="false" />
        </state>
      </button>
    </tab>
    <keyboard/>
  </ui>
  <groups ampVelTrack="0" attack="0.000" decay="25" sustain="1.0" release="0.430" volume="0.3345800042152405">
    <group tags="hiss" trigger="continuous" >
      <sample path="Samples/TapeHiss.wav" loopEnabled="true" />
    </group>
  </groups>
</DecentSampler>Code language: HTML, XML (xml)

An example of using continuous background sounds can be found in the Decent Samples Developer Examples repository here.

Multi-State Controls

Multi-state controls work in much the same way that button controls do. They allow you to create a control that can switch between multiple states, rather than just a continuous range of values. Here is an example of how you might use one of these:

<ui>
    <tab>
      <label text="Language" x="330" y="30" width="120" height="30" textSize="24" tooltip="this is a label tooltip test"></label>
      <control x="80" y="10" style="rotary" width="84" height="84" trackForegroundColor="FFF06C55" trackBackgroundColor="66999999" parameterName="Language" valueType="multi_state" value="10.0">
        <state name="English">
          <binding type="general" level="group" position="0" parameter="ENABLED" translation="fixed_value" translationValue="true" />
          <binding type="general" level="group" position="1" parameter="ENABLED" translation="fixed_value" translationValue="false" />
        </state>
        <state name="French">
          <binding type="general" level="group" position="1" parameter="ENABLED" translation="fixed_value" translationValue="true" />
          <binding type="general" level="group" position="0" parameter="ENABLED" translation="fixed_value" translationValue="false" />
          <binding type="general" level="group" position="0" parameter="ENABLED" translation="fixed_value" translationValue="false" />
        </state>
      </control>
    </tab>
  </ui>Code language: HTML, XML (xml)

An example of a multi-state control can be found in the Decent Samples Developer Examples repository here.

Definitely let me know if you run into any issues with either of these features. They are both new and I would love to hear your feedback on them.

All the best,
Dave

Posted on Leave a comment

Sample Creators: New Pitch Shift Effect

As of version 1.13.3, Decent Sampler now has a simple, old school pitch shift effect. This is a classic, delay-based implementation that can be found in a lot of 90s-era digital pitch shifters. It should be useful for adding old-school grit or faking a tape-recorder warble. Usage is pretty straightforward:

<DecentSampler minVersion="1.13.3">
  <ui>
    <tab>
      <labeled-knob x="375" y="75" width="90" textSize="16" textColor="AA000000" trackForegroundColor="CC000000" trackBackgroundColor="66999999" label="Pitch Shift" type="float" minValue="-24.0" maxValue="24.0" value="0">
        <binding type="effect" level="group" groupIndex="0" effectIndex="0" parameter="FX_PITCH_SHIFT"/>
      </labeled-knob>
      <labeled-knob x="445" y="75" width="90" textSize="16" textColor="AA000000" trackForegroundColor="CC000000" trackBackgroundColor="66999999" label="Mix" type="float" minValue="0.0" maxValue="1.0" value="1">
        <binding type="effect" level="group" groupIndex="0" effectIndex="0" parameter="FX_MIX"/>
      </labeled-knob>   
    </tab>
  </ui>
  <groups attack="0.000" decay="25" sustain="1.0" release="0.430" ampVelTrack="0.5">
    <group>
      <!-- ... samples go here ... -->

      <effects>
        <effect type="pitch_shift" pitchShift="0.0" mix="1" enabled="true"/>
      </effects>
    </group>
  </groups>
</DecentSampler>Code language: HTML, XML (xml)

The two parameters of the pitch_shift effect can also be modulated as follows:

<modulators>
  <lfo shape="sine" frequency="2" modAmount="0.3">
    <binding type="effect" level="group" groupIndex="0" effectIndex="0" parameter="FX_PITCH_SHIFT" modBehavior="add" translation="linear" translationOutputMin="-1" translationOutputMax="1"  />
  </lfo>
</modulators>Code language: HTML, XML (xml)

Example for how to use this effect can be found here.

Enjoy!

– Dave

Posted on 3 Comments

Sample Creators: About MPE Support in DecentSampler

Hi everyone!

Over the past year, MIDI Polyphonic Expression (MPE) support has been slowly evolving in DecentSampler. In fact, everything I’m discussing in this blog post has actually been in the sampler since version 1.11.6, but I haven’t documented it because I consider this functionality to be in alpha. Speaking of which, I don’t think anyone should make use of any of these features in commercial sample libraries until all of the kinks have been ironed out. As I work towards a stable feature set, I’m seeking feedback from sample library developers to ensure these new features meet your needs and enable more expressive virtual instruments.

New MPE Modulators & MPE Mode

The MPE functionality introduced in 1.11.6 consists of two new modulators that respond to MPE data:

  1. mpeTimbre – Responds to the timbre/slide dimension of MPE (CC74)
  2. mpePressure – Responds to per-note pressure messages

Before we can talk about using either of these, it’s important to know that you need to turn on MPE Mode in the File > Instrument Settings dialog box.

Working with mpeTimbre

The mpeTimbre modulator allows you to map the timbre on MPE controllers to various parameters. Here’s a practical example that maps timbre to filter frequency:

<mpeTimbre modAmount="0.5" scope="voice">
      <binding type="effect" level="group" groupIndex="0" effectIndex="0" parameter="FX_FILTER_FREQUENCY" 
        modBehavior="add"
        translation="table" 
        translationTable="0,33;0.3,150;0.4,450;0.5,1100;0.7,4100;0.9,11000;1.0001,22000"  />
    </mpeTimbre>
Code language: HTML, XML (xml)

This example uses a translation table to create a non-linear response curve, making the filter frequency changes more musical and intuitive.

Working with mpePressure

The mpePressure modulator responds to per-note pressure, enabling dynamic control over parameters based on how hard a key is pressed after the initial note-on. Here’s an example that maps pressure to amplitude:

<mpePressure modAmount="0.5" scope="voice">
      <binding type="amp" level="group" groupIndex="0" effectIndex="0" parameter="AMP_VOLUME" 
        modBehavior="set"
        translation="linear"
        translationOutputMin="0.5"
        translationOutputMax="1"  />
    </mpePressure>Code language: HTML, XML (xml)

This configuration allows for expressive volume control per note, with pressure scaling the volume between 50% and 100% of the original level.

Example Files

You can download a simple example file here:

Share Your Feedback

As I refine these features, I’m particularly interested in knowing if these modulators seem like reasonable way to approach MPE within DecentSampler. Specifically, I’m curious about:

  1. How you might use these modulators in your sample libraries
  2. Additional parameters or controls you’d find useful
  3. Any edge cases or specific scenarios we should test
  4. Suggestions for improving the XML syntax and structure

Please share your thoughts, suggestions, and any issues you encounter in the comments section of this blog post. Your input will help shape these features and ensure they meet the needs of the sample library development community.

All the best,
Dave