Over the past few months, several people have asked me if I could add microtuning support to Decent Sampler. This week, after purchasing a çifteli (pictured above) at a local thrift shop and discovering its unique scale, I finally decided to roll up my sleeves and see what I could do.
There is a new version (1.8.0) of Decent Sampler available here. It will be officially released on Monday, February 27th. This new version introduces the Tuning menu. This menu allows you load Scala (.scl) and Keyboard Mapping (.kbm files). It also allows you to specify a non-440Hz frequency for MIDI Note 69:
In order to use the microtuning functionality, you will need to get ahold of the .scl and .kbm files for the scale you are interested in. A great place to download a bunch of scales is here (look for the Download them all link in the Tuning Files section). Once you have those, you can load them using the Load .kbm Keyoard Mapping… and/or the Load.scl Scale… menu options.
When you specify a scale or keyboard mapping, your scale and keyboard mapping will get saved along with the DAW session. However, if you create a new track and put Decent Sampler on that track, the new track will revert back to the classic twelve-tone scale that most DS users expect. This is by design, but if someone thinks this behavior should be changed, let me know.
Sample creators can also embed scales in their instruments by adding a “tuningSclFile” and/or “tuningKbmFile” attributes to their top-level <DecentSampler> elements.
I want to thank the kind developers over at Surge synth for making their microtuning library available to all developers and for licensing it so generously. Without this, I would not have added microtuning support.
This is very much my first foray into the world of microtuning, so I expect that users will have suggestions. There will doubtless be a version 1.8.1 and a version 1.8.2. Let me know what you think!
EDIT: I’ve updated the screenshot above to show the new version of the Tuning menu.
This looks and functions almost exactly like the My Libraries tab. In fact, I’m hoping that we will be able to get rid of the My Libraries tab in favor of the File Browser soon, and when that happens I will probably just rename File Browser back to My Libraries and new users won’t know the difference. Both the File Browser and the old My Libraries aim to allow users to manage and load sample libraries from their own personal collections, but there are important differences in the way the two tabs work which is why I’m writing this post.
What the My Libraries tab was meant to be and where it fell short
Under the hood, Decent Sampler maintains a small, lightweight database that contains the locations of all of the sample libraries in a user’s personal collection. The plan was originally that the My Libraries tab would be used to manage this database. Every time a user loaded a Decent Sampler library, it would be added to the database, and from that point on it could be managed within the My Libraries tab. The My Libraries tab even offered the possibility of creating virtual folders to help with organizing sample libraries. This seemed like a great solution until I tried to use it for an extended period of time (I’m not only the creator of Decent Sampler, I’m also an avid user).
For desktop users, it is much easier to manage a folder containing many sample libraries using the tools provided by your operating system. Users (including me) would rename sample libraries on disk, delete them, or move them into folders that made logical sense. In such situations, the result would be that the reality as reflected in the database was often be different than what was on disk, and it was often difficult or even impossible to sync them up. To make matters more complicated, iOS users didn’t have the option of using the OS to manage their files well because, due to iOS limitations, all of their DecentSampler libraries are stored in a siloed file container called an AppGroup. Since the AppGroup is not accessible by the iOS Files app, users literally had no way of managing their files other than my using the My Libraries tab, which meant that if something went wrong with the internal database, they would be completely in the dark and stuck with useless files that were using up their precious device storage.
The Solution: The new File Browser tab
The new File Browser tab offers an accurate picture of whatever is stored in your Sample Libraries folder. For desktop users, this is the folder that you specified when you first launched the app, or that you chose in the Preferences dialog box. If you’re not sure where your Sample Libraries directory is, you can check its location by going to the Preferences dialog box and looking at the Sample Library Location entry (this option is not available on iOS):
As mentioned earlier, the new File Browser tab aims to provide an accurate list of the folders and files as they exist on disk. In the bottom left-hand corner are three icons which allows you to create, rename, and delete folders.
Unlike the folders that are created in the My Libraries tab, the folders in the File Browser are real folders that exist on disk. Be careful, if you delete a folder containing a bunch of sample libraries, the sample libraries contained with will be deleted as well (just like they would be on your operating system).
This view is very much a work in progress. (For example, at the time of writing, the search functionality is very slow on the file browser tab because every time it performs a search, it goes through the entire tree. This will be fixed in upcoming versions.) I wanted nonetheless to share the work in progress to let you all know the direction I’m hoping to take, as well as to get feedback from users and developers.
It brings with it a number of under-the-hood features that sample developers can make use of:
It’s now possible to color the keys of the on-screen keyboard.
This can be useful for showing different ranges of notes that serve different purposes or highlighting notes used as keyswitches. In order to implement colored keys, make use of the new <keyboard> and <color> elements as follows:
<DecentSampler><ui><em><!-- Other stuffhere --></em><keyboard><colorloNote="36"hiNote="50"color="FF2C365E" /><colorloNote="51"hiNote="57"color="FF6D9DC5" /><colorloNote="58"hiNote="67"color="FFCCF3F5" /><colorloNote="68"hiNote="73"color="FFE8DA9B" /><colorloNote="74"hiNote="84"color="FFD19D61" /></keyboard></ui><em><!-- Other stuff here --></em></DecentSampler>Code language:HTML, XML(xml)
By default, Decent Sampler highlights all of the notes that are mapped for a given sample. If you use the color keys feature, this default highlighting will be turned off and it will be up to you to color whatever keys you want.
In order to implemented dropdown menus, use the new <menu> and <option> elements. The <menu> element defines where the dropdown menu will show up in the ui, whereas the <option> XML elements determine what menu options it has and what if anything those options actually do:
<menux="10"y="40"width="120"height="30"value="2"><optionname="Menu Option 1"><!-- Turn on this group --><bindingtype="general"level="group"position="0"parameter="ENABLED"translation="fixed_value"translationValue="true" /><!-- Turn off this group --><bindingtype="general"level="group"position="1"parameter="ENABLED"translation="fixed_value"translationValue="false" /></option><optionname="Menu Option 2"><!-- Turn off this group --><bindingtype="general"level="group"position="0"parameter="ENABLED"translation="fixed_value"translationValue="false" /><!-- Turn on this group --><bindingtype="general"level="group"position="1"parameter="ENABLED"translation="fixed_value"translationValue="true" /></option></menu>Code language:HTML, XML(xml)
In this example, a menu is being used to switch between two groups (the first menu option turns group 0 on and group 1 off; the section option turns group 0 off and group 1 on). Full documentation for the new <menu> and <option> elements is here.
The new fixed_value translation type
You’ll note, in the example above, there’s something new in the bindings: the four bindings elements have a translation parameter of type fixed_value. This is a new translation type. Up until now, binding translation has strictly been about taking an input parameter (such as a knob value or continuous controller amount) and translating it so that it is useful for some other purpose (it’s our way of being able to do a little bit of math without having a full-blown scripting language). This new fixed_value binding is different. It ignores the input value completely and instead provides whatever is specified in the translationValue parameter. In this way, each menu option can have hardcoded values that it provides its bindings when it is selected.
It is now possible to implement keyswitches. For a long time, it’s been possible to trigger events when a MIDI continuous controller event is received: using MIDI CCs we can change knob values or group volumes, for example. It is now possible to trigger events using MIDI notes as well. Here’s what the setup for a MIDI note-based event mapping would look like:
A few weeks ago, Dave Hilowitz attached a slinky to his violin effectively turning his home studio into a giant reverb tank. Now, we’re releasing a free sample library based on that experiment. Check it out: