Sample-sets¶
There are many free sample-sets available for download on the SamplerBox website. You may also use SFZ (soundfont) packages or even create your own sets!
Where to put samples¶
SamplerBox looks for sample-set directories in three places, in this order of priority:
- User-defined directory in
config.ini
/media/
(USB drive)/samples/
(SD card)
Note
If the user-defined directory cannot be found, SamplerBox will look for a mounted USB drive. Failing that, the default /samples/
directory
will be used.
USB drive¶
This is the easiest way to get samples from your computer to your SamplerBox. By default, SamplerBox will look for directories in the root of your USB drive. A setlist.txt file will be automatically generated that will include the name of every directory listed alphanumerically. You can reorder the lines in the setlist.txt file on your PC, or do it via the System mode 1 menu.
Hint
If you’d prefer to have your sample-sets in a subdirectory on your USB drive (or indeed anywhere else) find the line SAMPLES_DIR = None
in your config.ini
and change it to
SAMPLES_DIR = /media/subdirectory
.
SD card (advanced)¶
A third partition on your SD card is available for samples (mounted to /samples/
). When the Raspberry Pi is running it is
mounted as read-only to extend the life of the SD card.
To manage your sample-sets here you must first remount the partition as read-write by entering the following on the Raspberry Pi’s command line:
mount -o remount,rw /samples
You can now upload/delete sample-sets via your SFTP client.
It is also possible to manage samples on your PC computer. However, Windows machines only detect the first partition of an SD card.
In the case of SamplerBox this is the /boot/
partition. There are ways to gain access to other partitions but that is not covered here.
Note
SamplerBox issues mounting commands from the program. This is how it can manage sample-sets and the setlist from the within the program.
Download sample-sets¶
There are a number of free instruments available for download on the SamplerBox website.
SFZ SoundFont packages currently have limited support, but they should work. There are many free downloads available on the web.
Make your own samples¶
Samples¶
SamplerBox currently only reads WAV files. Fortunately every modern audio editor can work with them.
Use your favourite audio editor to cut up your instrument into note samples.
Loop markers¶
To save loop markers to WAV files you must use a sound editor that is capable of this, eg Sony Soundforge. SamplerBox will recognise loop markers and loop your sounds!

A premium alternative is Extreme Sample Converter which can auto-detect and save suitable loop markers.
Make a sample-set¶
Once you have a collection of samples you must first put them in a directory into one of the three directories listed above so that SamplerBox can find them.
Now you need to prepare the directory in a way that SamplerBox can read the samples. There are 4 ways to do this:
- Name every sample file by its note name. eg C1.wav, F#1.wav, C2.wav, F#2.wav etc, or
- Name every sample file by its corresponding MIDI number. eg 40.wav, 45.wav, 50.wav, 55.wav etc, or
- Create a text file named
definition.txt
in your sample-set’s directory. Instructions below, or - Use a sample-set with a accompanying SFZ definition file, or create your own if you prefer (instructions not covered here).
Note
SamplerBox will attempt to fill all missing notes.
Warning
Not all options found in SFZ files will be read by SamplerBox. eg attack, decay, EQ.
Definition files¶
If you’re not naming your samples by the convention 45.wav
, 46.wav
etc, or C1.wav
, C#1.wav
etc, you can
create a definition.txt
file inside a sample-set’s directory. This file tells SamplerBox how to read and playback
samples.
Definition of sample names¶
In the most basic situation, the sample files within the folders have to be called 0.wav
, 2.wav
and so on until 127.wav
.
A more advanced way to manage sample-sets is to use a definition.txt
which uses filename definitions and keywords to determine
how SamplerBox finds and performs samples.
Global behaviour keywords¶
These are global keywords in the definition.txt for influencing the playback upon load of a preset/sample-set. For every keyword not defined in the file, the default value is used.
Note
In System mode 1 it is possible to modify these keywords from menu.
%%mode¶
%%mode= | Description |
---|---|
Keyb | (Default) “Normal”: end on note-off and use loop markers if any while key is pressed
(original SamplerBox).
|
Once | “Playback”: play sample from start to end ignoring standard note-off.
|
On64 | Like “once” but now only notes 0-63 can be used; use note+64 to stop playback
(=send note-off)
|
Loop | Like “on64”, but also loop markers will be recognized; more versitale than “On64”
|
Loo2 | Like “loop”, but the loop will stop when playing the same note (=2nd keypress sends
note-off).If the sample has no loop markers it will stop when exhausted, but pressing
the key a second time is still required before the sample can be played again!
This mode mimicks Korg-KAOSS and some groove samplers.
|
%%velmode¶
The way that volume is derived from the velocity.
%%velmode= | Description |
---|---|
Sample | (Default) Volume equals the value in the sample, so it requires multiple
samples using the %velocity parameter to get differentiation.
|
Accurate | Played velocity influences volume directly. Multiple samples can still be used to
differentiate timbre, but now they must be normalized.
|
%%release¶
Time to fadeout playback volume from the sample level to zero after the key is released in tenth’s of seconds.
Default = 30 (~0.5s)
Allowed range: 0-127 (range of 0-2s)
%%gain¶
Adapts sample volume before alsamixer by means of a multiplication factor. With this you can adapt presets to SamplerBox input without actually changing the wav files.
Default = 1.0
Allowed range: 0.1-10.0
Warning
Setting this value too high may cause distorted playback.
%%pitchbend¶
The depth of the pitchbend in semitones.
A value of 12 means the pitch range is 1 octave up and down. Zero will disable the pitch wheel/joystick.
Default = 7
Allowed values: 0-24
%%fillnotes¶
Determines whether SamplerBox should attempt to fill notes that haven’t been assigned a sample.
For instance, you might have 2 samples in a directory: 40.wav
and 60.wav
. If %%fillnotes=Y
, the program will attempt to fill all missing notes (0-127)
with the appropriate sample. Otherwise if %%fillnotes=N
only midinotes 40 and 60 will be assigned a sample. All other keys will play nothing.
Default = Y
Allowed values: Y,N
Sample-level behaviour keywords¶
In addition to global keywords, sample-level keywords can be used. Some of these override global keywords. For example:
saw2.wav, %midinote=60, %voice=2, %fillnote=N
%midinote¶
Value range = 0-127
Define a sample’s MIDI note. For example 60 corresponds to middle C = C4.
%velocity¶
Value range = 1-127
Default = 127
A velocity sample is used from its value upwards till the next sample. Velocity values below lowest sample will use this lowest one.
%voice¶
Value range = 1-4
Default = 1
This enables loading different instruments in one sample set, so that switching between them has no delay.
%seq¶
Value range = 1-127
Default = 1
If you have multiple versions of the same sample (eg different snare samples) you can number them. On playback a random sample will be selected.
%fillnote¶
Values = Y, N, G
Default = G (use global setting)
Determines whether the sample at the specified note will fill surrounding notes.
%mode¶
Values = Once
Default = None
Currently only accepts Once. See %%mode
above for its functionality.
%mutegroup¶
Value range = 0-127
Default = 0 (no mute group)
Assign sample lines to a mutegroup. When performing a note from a mutegroup, any other sounds from the same group will be stopped/choked. Useful for instruments like hi-hats.
Examples¶
1. Velocity¶
The original GrandPiano set uses multiple lines specifying the wav’s to be selected and the corresponding fixed velocity value. Remember that default velocity is 127.
File names:
D#5v16.wav
D#6v4.wav
D#6v7.wav
D#6v11.wav
D#6v14.wav
D#6v16.wav
D#7v4.wav
definition.txt:
%%mode=Keyb
%%velmode=Sample
%notenamev4.wav,%velocity=40
%notenamev7.wav,%velocity=60
%notenamev11.wav,%velocity=80
%notenamev14.wav,%velocity=100
%notenamev16.wav
Alternatively, you can set the global velocity mode (%%velmode
) to either Accurate
(default) or Sample
.
Accurate
will scale the volume of a sample based on the velocity of the note played.
Sample
will look for velocity values in the definition.txt
(as in the example above).
%%mode=Keyb
%%velmode=Accurate
%notenamev14.wav
%notenamev16.wav
2. Naming and looping¶
I often use this definition set, which makes it possible to give the loops and fills a self explaining name. Directory on the left is interpreted correctly.
File names:
03 Alesis-Fusion-Bass-Loop.wav
4 takkeherrie.wav
6.wav
11 Carol.wav
20 130-bpm-electro-synth-loop.wav
21 Aggressive-saw-synth-bass-loop.wav
definition.txt:
%%mode=Loop
%%velmode=Accurate
%midinote*.wav
3. Voices¶
This is set 3 on the SDcard with voices. It uses actually one velocity range of the GrandPiano combined with Saw. The saw WAV’s are renamed with midinumber prefixed with notename plus an “m”.
File names:
A5v12.wav
A6v12.wav
A7v12.wav
C1v12.wav
c2m36.wav
C2v12.wav
c3m48.wav
C3v12.wav
definition.txt:
%%mode=Keyb
%%release=3
%%velmode=Accurate
%notenamev*.wav
%notenamem*.wav,%voice=2
Hint
You can also define the voice in the file name. eg c3_voice2.wav
will be found with %notename_voice%voice*.wav
in the definition.txt
4. Randomization¶
You might have a sample-set with a variation of samples of the same instrument note. In this example there are 4
samples/recordings of a kick drum and a snare drum. The %seq
keyword tells SamplerBox to play back a
different version of the kick or snare for every hit, thus giving a more realistic performance.
File names:
bonham-kick-1.wav
bonham-kick-2.wav
bonham-kick-3.wav
bonham-kick-4.wav
bonham-snare-1.wav
bonham-snare-2.wav
bonham-snare-3.wav
bonham-snare-4.wav
definition.txt:
%%mode=Once
%%velmode=Accurate
bonham-kick-%seq.wav
bonham-snare-%seq.wav
Note
SamplerBox may randomize samples in an order like this: 3-6-2-1-8-7-2. Notice how there are no consecutive repeats.
5. Playback mode¶
In this example the global %%mode
is Keyb
(normal playback), but 1 sample plays back from start to end ignoring the standard note-off.
File names:
mellotron C1.wav
mellotron E1.wav
mellotron G1.wav
aeroplane-sample.wav
definition.txt:
%%mode=Keyb
%%velmode=Accurate
mellotron %notename.wav
aeroplane-sample.wav, %mode=Once