I have added a few things to the sampler in version 1.9.18:
- There’s experimental support for FLAC files.
- It’s now possible to assign knobs to the start and end point of samples, as well as their loop points.
- 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