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.
|<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.|
|Set the default path used to locate samples referenced without a full path specification.||sample
|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.
|Specify the volume for a group or region. Value is specified in decibels. The maximum value is 0 dB.|
|Specify the pitch offset for a group or region, relative to the key value. The value is specified in semitones.|
|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.|
|Specify the note that will trigger a sample. The range is 0-127.|
|Specify the center pitch for a group or region. The range is 0-127. Samples above or below the center pitch will be retuned.|
|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.|
|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.|
|Specify the lowest velocity for a group or region. The range is 0-127.|
|Specify the highest velocity for a group or region. The range is 0-127.|
|The loop mode for a group or region. Allowed values are:
0 = no loop
|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.|
|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.|
|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.
|Used for key switching. A region will play only if the last received MIDI note number matches this value.|
|Used to determine whether a region is triggered at note on or note off. Currently only ‘attack’ is supported.|