SFZ Files

The SFZ file format is used to define instruments in a way that is understood by software samplers from different developers. The SFZ standard was first developed by Cakewalk. A complete specification of the SFZ file format and the opcodes used to define instruments can be found on the Cakewalk DevXchange.

What are SFZ files?

SFZ files are plain text files with a ‘.sfz’ file extension. The files contain ‘opcodes’ that determine how samples will be mapped across a standard MIDI keyboard, how each note will respond to velocity, and other attributes such as placement in the stereo field and tuning. The minimum requirements for creating or editing SFZ files are Textedit (Mac) or Notepad (Windows).

Creating your own SFZ files

Several methods may be used to create new SFZ files:

  • Create a new file using a text editor
  • Modify an existing SFZ file to suit your needs
  • Use SFZ editor software
  • Convert an existing sample library using a special utility
  • Use a scripting language to generate opcodes based on the contents of a folder

Note: see the SFZ page on the Camel Audio website for more information about the tools available for this purpose. In this manual we will focus on the specifics of the SFZ format relating to Alchemy and Alchemy Player.

The simplest of these methods is to copy an existing SFZ file and modify the referenced file names while taking care to ensure the key and velocity zones are correct for the desired mapping.

Creating a new SFZ file from a blank file using a text editor is practical for smaller instruments, or when combined with copy & paste and find & replace techniques for larger instruments.

Opcodes recognised by Alchemy

The following table lists the opcodes understood by Alchemy.

Note: other opcodes not listed here may be present in an SFZ file. For example, after converting a sample library from some other format to SFZ. These opcodes will be ignored in the current version of Alchemy, and will not have any effect on the playback of the instrument.

Opcode Usage Notes
<group> Used to define common values applied to all regions contained within the group. Multiple groups may be defined, each containing one or more regions.
<region> Used to define keyboard zones. Multiple regions may be defined.
//

// this is a comment

Comment markers; text placed after comment markers is ignored.
default_path

default_path=C:\Samples

default_path=..\Samples

Set the default path used to locate samples referenced without a full path specification.
sample

sample=Kick.wav

sample=..\Samples\Kick.wav

sample=C:\Samples\Kick.wav

Load the referenced sample using settings defined in the current region and group.

Full path or relative path specifications may be used to reference samples.

volume

volume=-6

Specify the volume for a group or region. Value is specified in decibels. The maximum value is 0 dB.
tune

tune=-6

Specify the pitch offset for a group or region, relative to the key value. The value is specified in semitones.
pan

pan=36

pan=-23

Specify the position within the stereo field for a group or region. The range is +/- 63 with negative values panning to the left; positive values pan to the right. A value of 0 is centered.
key

key=64

Specify the note that will trigger a sample. The range is 0-127.
pitch_keycenter

pitch_keycenter=64

Specify the center pitch for a group or region. The range is 0-127. Samples above or below the center pitch will be retuned.
lokey

lokey=36

Specify the lowest note that will trigger a group or region. The range is 0-127. Notes between pitch_keycenter and lokey will cause the sample in a region to be pitched down.
hikey

hikey=64

Specify the highest note for a group or region. The range is 0-127. Notes between pitch_keycenter and hikey will cause the sample in a region to be pitched up.
lovel

lovel=30

Specify the lowest velocity for a group or region. The range is 0-127.
hivel

hivel=127

Specify the highest velocity for a group or region. The range is 0-127.
loop_mode

loop_mode=0

The loop mode for a group or region. Allowed values are:

0 = no loop
1 = continuous
2 = sustain
3 = forward/back
4 = all

cutoff

cutoff=200

cutoff=10000

Specify the filter cutoff point for a group or region. The value is specified in hertz. The last used ‘cutoff’ value in the file is used as the value is global to the Alchemy source to which the SFZ is being imported.
fil_veltrack

fil_veltrack=64

Specify the filter cutoff keyboard tracking for a group or region. The range is 0-127. As with cutoff, this value is global to the Alchemy source.
seq_position

seq_position=2

Used to create round-robin zones, with the value specifying the position of a sample within the round-robin zone. The default value is 1. Defining a second region in the same zone with a seq_position value of 2 will cause sample playback to alternate.

A value higher than the total number of round-robin samples may be used to trigger the sample multiple times before the round-robin group is reset.

sw_last

sw_last=64

Used for key switching. A region will play only if the last received MIDI note number matches this value.
trigger

trigger=attack

Used to determine whether a region is triggered at note on or note off. Currently only ‘attack’ is supported.