Manual: SFZ Implementation

It is possible to load SFZ instruments through the Instrument Editor.

SFZ is a loosely standardized text-based instrument format with external sample files, and is the recommended format for instrument interchange with other applications. OpenMPT tries to support as many SFZ opcodes as possible, including some that are specific to other vendors; its sampler only supports a fraction of the features of a fully fletched SFZ player, though.

The following SFZ opcodes are supported:


 * default_path: The default path to search sample files in.
 * note_offset: Global transposition in semitones
 * octave_offset: Global transposition in octaves

,, ,

 * sample: The sample filename, relative to the SFZ file or default_path, if specified.
 * lokey: The lowest key this region is mapped to, either as a MIDI note index (0 to 127, 60 is middle-C) or scientific pitch designation (C, C#/Db, D, D#/Eb, E, F, F#/Gb, G, G#/Ab, A, A#/Bb or B, followed by an octave number; 4 is the middle octave, so C4 is middle-C).
 * hikey: The highest key this region is mapped to, in the same format as lokey.
 * pitch_keycenter</tt>: The pitch at which the sample is played at its original sample rate, in the same format as lokey</tt>.
 * key</tt>: Sets lokey</tt>, hikey</tt> and pitch_key_center</tt> to the specified value, which is in the same format as lokey</tt>.
 * bend_up</tt> / bendup</tt>: Sets the MIDI pitch-bend depth in cents.
 * pitchlfo_fade</tt>: Sets the sample auto-vibrato sweep in seconds (approximately).
 * pitchlfo_depth</tt>: Sets the sample auto-vibrato depth.
 * pitchlfo_freq</tt>: sample auto-vibrato rate.
 * volume</tt>: Sets the sample global volume, ranging from -144dB to +6dB.
 * pan</tt>: Sets the sample pan position, ranging from -100 (left) to +100 (right).
 * transpose</tt>: Transposes the region up or down by the specified amount of semitones.
 * tune</tt>: Detunes the sample by the specified amount of cents, ranging from -100 to +100.
 * <tt>end</tt>: Trims the sample to the specified length.
 * <tt>offset</tt>: Starts playing the sample at the specified offset. OpenMPT completely removes any leading waveform data.
 * <tt>loop_start</tt> / <tt>loopstart</tt>: Start of the sample loop.
 * <tt>loop_end</tt> / <tt>loopend</tt>: End of the sample loop.
 * <tt>loop_mode</tt> / <tt>loopmode</tt>: One of the following sample loop modes:
 * <tt>loop_continuous</tt>: Normal sample loop.
 * <tt>one_shot</tt>: Treated like <tt>loop_continuous</tt>.
 * <tt>loop_sustain</tt>: Sustain loop.
 * <tt>no_loop</tt>: Disable loop completely.
 * <tt>loop_type</tt> / <tt>looptype</tt>: One of the following sample loop types:
 * <tt>forward</tt>: Normal forward loop.
 * <tt>backward</tt>: Reverse loop.
 * <tt>alternate</tt>: Ping-pong loop.
 * <tt>loop_crossfade</tt>: Crossfades the loop start and end. The fade length is specified in seconds.
 * <tt>cutoff</tt>: Sets the filter cutoff frequency in Hz.
 * <tt>fil_random</tt>: Random cutoff variation in cents.
 * <tt>resonance</tt>: Sets the filter resonance in dB.
 * <tt>fil_type</tt> / <tt>filtype</tt>: One of the following filter types:
 * <tt>lpf_1p</tt> / <tt>lpf_2p</tt> / <tt>lpf_4p</tt> / <tt>lpf_6p</tt>: All treated as internal two-pole low-pass filter
 * <tt>hpf_1p</tt> / <tt>hpf_2p</tt> / <tt>hpf_4p</tt> / <tt>hpf_6p</tt>: All treated as internal two-pole high-pass filter
 * <tt>polyphony</tt>: The allowed maximum polyphony for this sample. Only a value of 1 is supported, in which case the Duplicate Note Check is set to Note Cut.
 * <tt>phase</tt>: Setting this to <tt>invert</tt> inverts the sample phase.
 * Envelopes: <tt>ampeg_…</tt> (volume envelope), <tt>fileg_…</tt> (filter envelope), <tt>pitcheg_…:</tt> (pitch envelope):
 * <tt>…eg_start</tt>: Start level of the envelope, ranging from -100 to +100.
 * <tt>…eg_delay</tt>: Delay, in seconds, until the attack phase of the envelope starts.
 * <tt>…eg_attack</tt>: Duration of the attack phase in seconds.
 * <tt>…eg_hold</tt>: Duration of the hold phase in seconds.
 * <tt>…eg_decay</tt>: Duration of the decay phase in seconds.
 * <tt>…eg_sustain</tt>: Sustain level of the envelope, ranging from -100 to +100.
 * <tt>…eg_release</tt>: Duration of the release phase in seconds.
 * <tt>…eg_depth</tt>: The depth of the envelope in cents. Only applies to pitch and filter envelopes.
 * <tt>region_name</tt>: Sets the sample name.

Miscellaneous

 * <tt>#define</tt> macros are supported. Macro names must start with a <tt>$</tt>, e.g. <tt>#define $duration 0.5</tt>
 * Sample files can be of any type supported by OpenMPT’s sample editor (WAV, FLAC, Ogg, Opus, MediaFoundation codecs, etc.)
 * Loop points are read from sample files (as far as they are supported by OpenMPT) if a region’s <tt>loop_mode</tt> is set but no loop points are provided.