Posted on Leave a comment

Sample Creators: How to Use Buses & Auxiliary Outputs

As of version 1.12.0, Decent Sampler has support for both audio buses and auxiliary outputs. Buses are a powerful feature that allow you to route audio to different auxiliary outputs and apply effects to the audio. This can be useful for creating complex audio routing setups and adding effects to groups of samples. This tutorial will show you how to use buses and auxiliary outputs in Decent Sampler.

Auxilary Outputs

By default, all audio in Decent Sampler is routed to the main audio output. However, you can also route audio to secondary auxiliary outputs. Auxiliary outputs are additional audio outputs that can be used to route audio to external effects processors or other audio devices within your DAW. Decent Sampler supports up to 16 auxiliary stereo outputs, which can be used to create complex audio routing setups.

There are two ways that you can route audio to auxiliary outputs in Decent Sampler:

  1. You can use the outputXTarget attributes in the <sample><group>, or <groups> elements to directly specify the audio output that the sample should be routed to. The available options are MAIN_OUTPUT (the main audio output, which is the default) and AUX_STEREO_OUTPUT_1 through AUX_STEREO_OUTPUT_16 (the auxiliary outputs).
  2. You can also route audio from the samples to user-defined buses, and then route audio from the buses to the auxiliary outputs. This allows you to apply effects to the audio before sending it to the auxiliary outputs. We’ll cover that more below in the Buses section.

Example 1: Routing audio to an auxiliary output

In this example, we will route audio from a sample to an auxiliary output. To do this, we will use the outputXTarget attributes in the <sample> element to specify the audio output that the sample should be routed to. Here is an example of how you can route audio to AUX_STEREO_OUTPUT_1:

<group output1Target="MAIN_OUTPUT" output1Volume="1.0" output2Target="AUX_STEREO_OUTPUT_1" output2Volume="0.5" />
    <!-- Samples go here -->
</group>

In this example, the audio from the samples in the <group> element will be routed to the main audio output with a volume of 1.0, as well as to auxiliary output 1 with a volume of 0.5.

Buses

As mentioned above, buses can be used to create a more complex mix of the samples in the sample library as well as route audio to various audio outputs. Sample library designers can specify up to 16 buses in the <buses> element using the <bus> tag. Each bus can have its own volume and audio output settings. For a full list of attributes that can be used in the <bus> element, see the Buses Element documentation.

Example 2: Applying effects to audio using buses

In this example, we will apply an effect to audio using a bus. To do this, we will define a bus with an effect applied to it, and then route audio from the samples to the bus. Here is an example of how you can apply a reverb effect to audio using a bus:

<buses>
    <bus busVolume="0.5" output1Target="MAIN_OUTPUT" output2Target="AUX_STEREO_OUTPUT_1" output1Volume="0.8" output2Volume="0.5">
        <effects>
            <effect type="Reverb" wetDryMix="0.5" roomSize="0.5" damping="0.5" />
        </effects>
    </bus>
</buses>
<group output1Target="MAIN_OUTPUT" output2Target="BUS_1" output2Volume="1.0">
    <!-- Samples go here -->
</group>

In this example, a bus is defined with a reverb effect applied to it. The audio from the samples in the <group> element will be routed to the main audio output with a volume of 1.0, as well as to the bus with the reverb effect applied to it.

Conclusion

Buses and auxiliary outputs are powerful features in Decent Sampler that allow you to create complex audio routing setups and apply effects to groups of samples. By using buses and auxiliary outputs, you can create more dynamic and interesting sample libraries that take full advantage of Decent Sampler’s capabilities. You can find working examples of both audio outputs and buses in the official Decent Sampler example repository (look in the Example 10 directory).

Have fun!

– Dave Hilowitz

Posted on Leave a comment

Saving User Presets in DecentSampler: A Quick Guide

As a DecentSampler user, you’ve likely spent time tweaking and perfecting your sound. But what if you want to save these settings for future use? Good news! DecentSampler allows you to save user presets for any library you’re currently using. Here’s how to do it:

Step 1: Convert Your Library Format

Before you can save user presets, you need to ensure your library is in the correct format. Specifically, if your library is in a .dslibrary format, you must first convert it to either a .dsbundle or a folder-based preset.

Method 1: Converting .dslibrary files using Decent Sampler

The easiest way to convert a .dslibrary file is by using the DecentSampler plug-in itself:

  1. Simply drag that .dslibrary file onto the DecentSampler plug-in window. 
  2. You will see a box that says Do you want to install this preset?, click Yes.
  3. DecentSampler will decompress the .dslibrary file and create a new .dsbundle directory wherever you keep your sample libraries. For a list of the default sample library locations, see here.

Method 2: Manually Method

If Method 1 doesn’t work for some reason, you can also convert the file yourself. At their core, .dslibrary files are just .zip files with a different extension. 

  1. Change the extension on the .dslibrary file to .zip.
  2. Decompress the .zip file and put it wherever you store your sample libraries. If you are on macOS or Windows, this will be as easy as simply double-clicking the .zip file.

Step 2: Set Up Your Sound

Now that your library is in the correct format, load it and adjust the parameters to your liking. This could include changes to the envelope, filter settings, effects, or any other adjustable parameters within the library.

Step 3: Access the FILE… Menu

Once you’re happy with your sound, look for the FILE… menu. This is typically located at the top of the DecentSampler interface.

Step 4: Choose “Developers Tools > Save Preset…”

In the preset menu, you should see an option to “Save Preset…”. Click on this option.

Step 5: Select Save Location and Name Your Preset

A dialog box will appear, prompting you to save your preset. It is important that you save the preset in the same location as the other presets for this library – DecentSampler will usually suggest the correct location as the default location. Choose a name that’s descriptive and easy to remember. For example, “Warm Pad with Long Release” or “Punchy Bass with Distortion”.

Step 6: Confirm and Save

Once you’ve named your preset, click “Save” or “OK” to confirm. Your preset is now saved and ready for future use!

Accessing Your Saved Presets

To use your saved preset in the future:

  1. Load the same library you used when creating the preset (remember, it must be the .dsbundle or folder-based version).
  2. A box will pop up showing you all of the presets that belong to that library. 
  3. Find and select your new saved preset.

Remember, user presets are specific to the library you’re using. A preset saved while using one library won’t be available when you’re working with a different library.

Happy sampling, and enjoy the convenience of your personalized DecentSampler presets!

Posted on Leave a comment

Sample Creators: Here’s how to use the new XY Pad UI control

Hello! Version 1.11.12 of Decent Sampler introduces a useful new UI control: an XY pad. Here’s an example that I’ve colored yellow:

A screenshot of an XY Pad

This control is similar to a knob or a slider except that it works in two dimensions. For sample library creators who have worked with knobs and sliders will find that setting up this new control is pretty similar to those controls. The main difference between an XY pad and a knob is that instead of having one set of bindings it has two: one for the X axis and one for the Y axis. The code for the example above is this:

<xyPad x="10" y="10" width="300" height="195" parameterName="Pad" xValue="0.5576778054237366" yValue="0.4821614623069763" bgColor="77FFCC00" markerFillColor="FFFFFFFF" outlineColor="77FFFFFFF">
        <x>
          <binding type="amp" level="group" groupIndex="0" parameter="AMP_VOLUME" translation="linear" translationOutputMin="0" translationOutputMax="1"/>
          <binding type="amp" level="group" groupIndex="1" parameter="AMP_VOLUME" translation="linear" translationOutputMin="1" translationOutputMax="0"/>
        </x>
        <y>
          <binding type="effect" level="instrument" effectIndex="0" parameter="FX_FILTER_FREQUENCY" translation="table" translationTable="0,33;0.3,150;0.4,450;0.5,1100;0.7,4100;0.9,11000;1.0001,22000"/>
        </y>
      </xyPad>
Code language: HTML, XML (xml)

You’ll note that the current value on the X axis can be found in the xValue attribute, and the current value for the Y axis can be found in the yValue attribute. XY Pads are automatable using DAW automation.

To learn more about this control, see the updated documentation here. You can download this example here – you’ll find it in the example 9 directory.

Enjoy!

– Dave

Posted on Leave a comment

Sample Creators: Introducing Note Sequences

Hello Sample Creators!

I have a couple of news items I wanted to share. First, I’m thrilled to announce a new update to Decent Sampler – a tiny but mighty sequence playback engine hidden right within the plugin. This new feature lets you embed simple note sequences directly into your sample libraries. This opens up a world of possibilities for sample library makers. For example:

  • Guitar libraries: Strumming patterns, arpeggios, and riffs
  • Drum libraries: Provide essential preset beats and fills to jumpstart users’ creative flow.
  • Melodic libraries: Craft short phrases or even full melodic sequences.
  • World percussion libraries: Embed traditional rhythms and grooves to enhance authenticity.

Learn more about how to use these here. By the way, for those of you who are Patrons, the latest version of the Omnichord sample library makes use of the new sequencer functionality. Each of the Omnichord strums is a little 13 note sequences that gets played when the user hits a key.

Which brings us to our second news item: the DecentSamples File Format Developer Guide has been moved here. As I was typing up documentation for the note sequencer stuff, I felt we’d finally reached the moment where we needed to break all of the information in the guide into several discreet pages. I’m now using ReadTheDocs service to help me host and organize the documentation.

OK. I think that’s it. As always, let me know if you find any bugs.

– Dave

Posted on 3 Comments

For Sample Creators: How to Add Tempo-Synced Delay to your Instruments

Up until now, the Delay effect has allowed users to specify the amount of delay in seconds. A brand new feature in version 1.10.0 of Decent Sampler adds the possibility of syncing the delay time to the host clock, and allowing users to specify their delay time in musical time units (eg. quarter notes, eighth notes, etc.). In this article, we’ll talk about how to make use of this new functionality.

1. Getting Started

The patch we are going to be working with is just a basic triangle wave sample library. This is what the code looks like:

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

<DecentSampler>
  <ui>
    <tab></tab>
  </ui>
  <effects></effects>
  <groups attack="0.0" decay="1.0" sustain="0.0" release="1.75" ampVelTrack="0.3">
    <! -- sample definitions are here -->
  </groups>
</DecentSampler>

Code language: HTML, XML (xml)

(For the sake of brevity, I’ve removed the portions of the code listings that contain the sample definitions, as they are not important for this tutorial.) As you can see, the UI is blank and there are no effects added yet. By the way, if you wish to follow along, this starting code can be found here in the file labeled Step 1.

2. Adding the Basic Delay Effect

Our first order of business is to add in the delay effect as well as some knobs to control it. Here how that looks:

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

<DecentSampler>
  <ui>
    <tab>
      <labeled-knob x="180" y="40" label="Delay Time" valueType="float" minValue="0" maxValue="5" value="0.5">
        <binding type="effect" level="instrument" position="0" parameter="FX_DELAY_TIME" translation="linear"/>
      </labeled-knob>
      <labeled-knob x="280" y="40" label="Feedback" valueType="float" minValue="0" maxValue="1" value="0.5">
        <binding type="effect" level="instrument" position="0" parameter="FX_FEEDBACK" translation="linear"/>
      </labeled-knob>
      <labeled-knob x="380" y="40" label="Stereo Offset" valueType="float" minValue="0" maxValue="1" value="0.01">
        <binding type="effect" level="instrument" position="1" parameter="FX_STEREO_OFFSET" translation="linear"/>
      </labeled-knob>
      <labeled-knob x="480" y="40" label="Wet Level" valueType="float" minValue="0" maxValue="1" value="1">
        <binding type="effect" level="instrument" position="0" parameter="FX_WET_LEVEL" translation="linear"/>
      </labeled-knob>
    </tab>
  </ui>
  <effects>
    <effect type="delay" delayTime="0.5" stereoOffset="0.01" feedback="0.2" wetLevel="0.5" />
  </effects>
  <groups attack="0.0" decay="1.0" sustain="0.0" release="1.75" ampVelTrack="0.3">
    <! -- sample definitions are here -->
  </groups>
</DecentSampler>
Code language: HTML, XML (xml)

As you can see, we’ve added our delay in on line 21. In lines 6 through 17, we’ve added in some controls that let us fine-tune various aspects of our delay effect. In this article, we’re going to be focusing almost exclusively on that first control: Delay Time. Right now, the delay effect is receiving information about how long the delay should be from that first control in seconds. The control has a valueType of float, which stands for “floating-point number”, which is the default valueType. This basically means that the number that control is going to output will be anything between the minimum and the maximum. In other words, it could be a whole number, it could be fractional, float means that pretty much anything goes.

(If you wish to see this iteration of the code, it can be found here in the file labeled Step 2.)

3. Adding in tempo syncing

Up until now, we’ve been specifying our time in seconds, and, even if the plugin is being run within some host software, the delay time is not being synced to the tempo of that software at all. Let’s change that. Here’s what the new code looks like:

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

<DecentSampler>
  <ui>
    <tab>
      <labeled-knob x="180" y="40" label="Delay Time" valueType="musical_time" value="10">
        <binding type="effect" level="instrument" position="0" parameter="FX_DELAY_TIME"/>
      </labeled-knob>
      <!-- more knob definitions we don't care about right now -->
    </tab>
  </ui>
  <effects>
    <effect type="delay" delayTimeFormat="musical_time" delayTime="0.5" stereoOffset="0.01" feedback="0.2" wetLevel="0.5" />
  </effects>
  <groups attack="0.0" decay="1.0" sustain="0.0" release="1.75" ampVelTrack="0.3">
    <! -- sample definitions are here -->
  </groups>
</DecentSampler>
Code language: HTML, XML (xml)

There are two important things to note here:

First, on line 6, we’ve changed the valueType of our Delay Time knob to musical_time. This is a special, magic value that will cause the control to display a series of standard musical time increments. For those curious, here are the actual time increments that will be used: 1/64 triplet, 1/64, 1/32 triplet, 1/64 dotted, 1/32, 1/16 triplet, 1/32 dotted, 1/16, 1/8 triplet, 1/16 dotted, 1/8, 1/4 triplet, 1/8 dotted, 1/4, 1/2 triplet, 1/4 dotted, 1/2, 1 triplet, 1/2 dotted, 1, 1/1 dotted. On the back end, this will be transmitted out to the delay effect as a whole number from 0 to 20.

Of course, our delay effect was set to expect its time in seconds, right? So if we were to leave the Delay effect alone, it would misinterpret that special magic number coming from the knob as a value in seconds. To fix this, we’ve added a brand new delayTimeFormat="musical_time" attribute to the <effect> element on line 13. Now, the Delay effect knows that its time is being set using the special magic array of musical time options. For example, if it receives a value of 4 from a binding, it no knows that that does not mean 0 seconds, it means 1/32 note relative to whatever the host tempo is.

By the way, if you wish to see this iteration of the code, it can be found here in the file labeled Step 3. It already works really nicely.

4. Adding a knob that allows the user to switch between Seconds and Musical Time

So you may be wondering what happens if the plug-in is being run in standalone mode. Well, in such a situation, DecentSampler isn’t able to receive a tempo from the host software, so it defaults to 120 beats per minute. Because of this scenario, it is often wise to include a button that lets users switch between musical time and clock time. Here’s how we do that:

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

<DecentSampler>
  <ui>
    <tab>
      <label x="101" y="57" width="80" height="30" text="Tempo Sync" textSize="15" />
      <button x="101" y="90" width="80" height="30" value="0">
        <state name="On">
          <binding type="effect" level="instrument" position="0" parameter="FX_DELAY_TIME_FORMAT" translation="fixed_value" translationValue="musical_time" />
          <binding type="control" level="ui" position="2" parameter="VALUE_TYPE" translation="fixed_value" translationValue="musical_time" />
          <binding type="control" level="ui" position="2" parameter="VALUE" translation="fixed_value" translationValue="10" />
        </option>
        <state name="Off">
          <binding type="effect" level="instrument" position="0" parameter="FX_DELAY_TIME_FORMAT" translation="fixed_value" translationValue="seconds" />
          <binding type="control" level="ui" position="2" parameter="VALUE_TYPE" translation="fixed_value" translationValue="float" />
          <binding type="control" level="ui" position="2" parameter="VALUE" translation="fixed_value" translationValue="0.25" />
          <binding type="control" level="ui" position="2" parameter="MIN_VALUE" translation="fixed_value" translationValue="0" />
          <binding type="control" level="ui" position="2" parameter="MAX_VALUE" translation="fixed_value" translationValue="5" />
        </option>
      </button>
      <labeled-knob x="180" y="40" label="Delay Time" valueType="musical_time" value="10">
        <binding type="effect" level="instrument" position="0" parameter="FX_DELAY_TIME"/>
      </labeled-knob>
      <!-- a bunch of controls we don't care about right now -->
    </tab>
  </ui>
  <effects>
    <effect type="delay" delayTimeFormat="musical_time" delayTime="0.5" stereoOffset="0.01" feedback="0.2" wetLevel="0.5" />
  </effects>
  <groups attack="0.0" decay="1.0" sustain="0.0" release="1.750873208045959" ampVelTrack="0.3">
    <groups attack="0.0" decay="1.0" sustain="0.0" release="1.75" ampVelTrack="0.3">
    <! -- sample definitions are here -->
  </groups>
</DecentSampler>

Code language: HTML, XML (xml)

Woah, there’s a lot here! Let’s walk through it line by line: On line 6, we’ve added is a label. This is purely for descriptive purposes. Next, we’ve got a button with two states. Each state has a number of different bindings as each time the state gets changed, we are not only going to be changing effect’s settings, but also the settings for the Delay Time knob. Here is what is happening in each of the two states:

In the “On” state, on line 9, we change the delayTimeFormat setting to musical_time for the Delay effect. After that, on line 10, we set the valueType to musical_time for our Delay Time knob (which has an index of 2). Finally, one line 11, we set a value so that when the user switches states, the control doesn’t get set to some random value. In this case, I’ve decided to set it to 10, which corresponds to eighth notes in the magical musical_time numbering system.

Moving on, let’s look at the “Off” state. The first thing we do when time sync is switched off is, on line 14, we change the delayTimeFormat setting to seconds for the Delay effect. After that, on line 15, we set the valueType to float for our Delay Time knob. Next, on line 16, we set a value so that when the user switches states, the control doesn’t get set to some random value. In this case, I’ve decided to set it to 0.25 seconds, which corresponds to eighth notes if the tempo were 120BPM. This was arbitrary decision on my part, but it seems to sound nice. Last but not least, on lines 17 and 18, we set minimum and maximum values for our control. We do this because before, when our control was in musical_time mode, its minimum and maximum values are automatically set to 0 and 20, respectively in order to accommodate the musical time system. We now need to reset them to plausible limits.

This final version of the code can be found here in the labeled Step 4.

Conclusion

I know this last case seems like a lot of code, and it may, at first, be a bit confusing. The good news is that for the most part you can just copy and paste the code above into your projects. Just make sure you change those pesky position values within the bindings, so that the bindings actual point to the controls and effects you want to change. 😉

Enjoy!

– Dave

Posted on Leave a comment

For Sample Creators: Changing Sample Start, End, and Loop Points using GUI controls

I have added a few things to the sampler in version 1.9.18:

  1. There’s experimental support for FLAC files.
  2. It’s now possible to assign knobs to the start and end point of samples, as well as their loop points.
  3. It’s now possible to dictate the playback engine that is used by a sample library.

Now, the first item above is probably pretty self-explanatory, this blog post is going to concern itself with items 2 and 3.

How To Manipulate Start, End, and Loop Points

To change a sample’s start, end, loop start, or loop end, simply use the SAMPLE_START, SAMPLE_END, LOOP_START, and LOOP_END parameter names, respectively. Here is some sample code:

<labeled-knob x="445" y="75" width="90" textSize="16" textColor="AA000000" 
                    trackForegroundColor="CC000000" trackBackgroundColor="66999999" 
                    label="Start" type="integer" minValue="0" maxValue="24000" value="0" >
        <binding type="general" level="group" position="0" parameter="SAMPLE_START" />
      </labeled-knob>
      <labeled-knob x="515" y="75" width="90" textSize="16" textColor="AA000000" 
                    trackForegroundColor="CC000000" trackBackgroundColor="66999999" 
                    label="End" type="float" minValue="0.0" maxValue="24000" value="24000" >
        <binding type="general" level="group" position="0" parameter="SAMPLE_END" />
      </labeled-knob>
      <labeled-knob x="585" y="75" width="90" textSize="16" textColor="AA000000" 
                    trackForegroundColor="CC000000" trackBackgroundColor="66999999" 
                    label="Loop Start" type="float" minValue="0.0" maxValue="24000" value="0" >
        <binding type="general" level="group" position="0" parameter="LOOP_START" />
      </labeled-knob>
      <labeled-knob x="655" y="75" width="90" textSize="16" textColor="FF000000"
                    trackForegroundColor="CC000000" trackBackgroundColor="66999999"
                    label="Loop End" type="float" minValue="0" maxValue="24000" value="24000">
        <binding type="general" level="group" position="0" parameter="LOOP_END" />
      </labeled-knob>
Code language: HTML, XML (xml)

In order for this to work properly the sample playback engine must be in RAM/Memory mode (not disk streaming), otherwise you will get very unpredictable results. In order to enforce this, sample creators should use the new playbackMode attribute, which is explained in the next section…

Playback Engines

As you may know, there are two playback modes: the memory mode stores a samples in memory, whereas the disk streaming mode caches only the beginning of each sample, and then uses a series of threads to grab data as needed. Because the memory mode has all of the data it could possible need in its memory already, it is far more flexible in terms of what can be accomplished with it, but, since it loads the entire sample into memory, it can also use up a lot of RAM for large sample libraries. Currently, users can change their playback mode by going into the preferences screen and choosing a new Sample Engine Mode:

97% of the time, this is exactly what you want: the user choosing their own playback system. The problem is that some sample libraries work much better with one mode vs the other. If the sample library has knobs bound to start, end, loopStart, or loopEnd, then being in RAM mode is actually required. Of course, no sample creator wants to have to tell their users “Oh, by the way, make sure you switch playback modes in the preferences before you use my new sample library.” The solution is the playbackMode attribute. It has three possible modes: memory, disk_streaming and auto(default). When a value of memory is used, the sample will be played back using the memory mode as though the user had that playbackEngine selected in the preferences.

OK. I think that’s it. Enjoy!

– Dave

Posted on Leave a comment

Q: Is it possible to extract the samples contained within Decent Sampler instruments?

Occasionally, users will reach out and ask me whether it’s possible to extract the samples contained in a Decent Sampler library. One common use-case for this is users who want to use the samples with a hardware sampler such as an MPC or an SP-404. Anyway, the answer to the question is that in some cases it’s possible and in others it is not.

Me: “Are you sure you really want to do this?”

Before we go into the details of when it’s possible, it’s worth mentioning that a Decent Sampler instrument is usually much more than just a collection of samples: a creator of a library will often have made use of creative layering techniques as well as onboard effects, both of which play a huge part in producing the distinctive sound of a library. This means that the only reliable way of getting the intended sound of a library is to actually use the output from DecentSampler as your sound. This doesn’t mean that you are out of luck if you want to use these sounds with a hardware sampler. You can always load DecentSampler up in your DAW of choice, play a bunch of long notes, and then export the audio out from that session. This will often yield better sound than if you were to just go directly into the sample library and grab the underlying samples.

You: “OK, but I still want to do it!”

So, assuming that you really do want to grab the underlying audio files, here’s what you need to know. First, if the sample library is a commercial release and copy-protected then you are out of luck: the underlying wave files will all encrypted and the only thing that can decrypt them is the DecentSampler plugin itself. In such cases, the only thing that you can do is go into your favorite DAW, play any notes you might want to have as audio files, and export out the audio from that DAW session. This is always my preferred way of operating anyway.

If the library is not copy protected, then you should definitely be able to get at the underlying samples. In fact, it’s pretty easy. There are two formats that DecentSampler libraries come in:

  1. If you are presented with a .dsbundle file, this is really just a directory. If you are on Windows or Linux, you should be able to just look inside that directory and find the sample files. If you are on Mac, this file will show up as a “package.” To get access to it, find the file in the Finder, hold down the Control key, and then click on the file: a context menu will pop up, from which you should select Show Package Contents. From this point on, the .dsbundle file will be presented to you just like any other folder…and somewhere in that folder you will find the raw audio files. The exact location will be different for every library.
  2. If you are presented with a .dslibrary file, then you will need to decompress it. In reality, .dslibrary files are simply .zip files, and if you change their extension from .dslibrary to .zip you should be able to decompress the library just as you would any other .zip file. Within the directory structure that gets created, you should be able to find a folder that contains your samples.

That’s it! Hope this was helpful.

– Dave