Skip to content

SFZ v2 Opcodes

Note that modulations such as (on)ccN, and vel2* opcodes are included in the pages describing the parameters they modulate.

Sound Source: Sample Playback

Opcode Description Type Default Range
delay_samples Region delay, in sample units. integer N/A N/A
delay_beats Delays the start of the region until a certain amount of musical beats are passed. float N/A N/A
stop_beats Stops a region after a certain amount of beats have played. float N/A N/A
loop_crossfade Loop cross fade, in seconds. float N/A N/A
md5 The MD5 hash for an encoded sample. It will be a 128-bit key in hex. string null N/A
reverse_loccN If MIDI CC X is between reverse_loccN and reverse_hiccN, the region plays reversed. integer N/A 0 to 127
reverse_hiccN If MIDI CC X is between reverse_loccN and reverse_hiccN, the region plays reversed. integer N/A 0 to 127
waveguide Enables waveguide synthesis for the region. string N/A on, off

Instrument Settings

Opcode Description Type Default Range
define Creates a variable and gives it a value. string N/A N/A
default_path Relative path for samples. string N/A N/A
note_offset Tells SFZ to shift all incoming MIDI data by the specified number of notes. integer N/A N/A
octave_offset Shifts all incoming MIDI data by the specified octave. integer N/A N/A
set_ccN Sets a default initial value for MIDI CC number X, when the instrument is initially loaded. integer N/A 0 to 127

Instrument Settings: Voice Lifecycle

Opcode Description Type Default Range
polyphony Polyphony voice limit for a group. integer N/A N/A
rt_dead Controls whether a release sample should play if its sustain sample has ended, or not. string off on, off

Region Logic: MIDI Conditions

Opcode Description Type Default Range
sustain_sw Turns the sustain switch on or off. string N/A on, off
sostenuto_sw Turns the sostenuto switch on or off. string N/A on, off
loprog The region plays when the MIDI program number is between loprog and hiprog. integer 0 0 to 127
hiprog The region plays when the MIDI program number is between loprog and hiprog. integer 127 0 to 127

Region Logic: Internal Conditions

Opcode Description Type Default Range
lotimer Region plays if timer is between lotimer and hitimer. float N/A N/A
hitimer Region plays if timer is between lotimer and hitimer. float N/A N/A

Region Logic: Triggers

Opcode Description Type Default Range
start_loccN If a MIDI control message with a value between start_loccN and start_hiccN is received, the region will play. An alias for on_loccN. integer -1 (unassigned) 0 to 127
start_hiccN If a MIDI control message with a value between start_loccN and start_hiccN is received, the region will play. An alias for on_hiccN. integer -1 (unassigned) 0 to 127
stop_loccN If a MIDI control message with a value between stop_loccN and stop_hiccN is received, the region will stop playing. integer -1 (unassigned) 0 to 127
stop_hiccN If a MIDI control message with a value between stop_loccN and stop_hiccN is received, the region will stop playing. integer -1 (unassigned) 0 to 127

Performance Parameters: Filter

Opcode Description Type Default Range
cutoff2 Same as cutoff, but used to specify the cutoff for the second filter. N/A N/A
fil2_keycenter Same as fil_keycenter, but used to specify the type for the second filter. integer 60 0 to 127
fil2_keytrack Same as fil_keytrack, but used to specify the type for the second filter. integer 0 0 to 1200
fil2_type Same as fil_type, but used to specify the type for the second filter. string lpf_2p lpf_1p, hpf_1p, lpf_2p, hpf_2p, bpf_2p, brf_2p
fil2_veltrack Same as fil_veltrack, but used to specify the type for the second filter. integer 0 -9600 to 9600
resonance2 Same as resonance, but used to specify the resonance for the second filter. float N/A N/A

Performance Parameters: Pitch

Opcode Description Type Default Range
bend_stepup Pitch bend step, in cents, applied to upwards bends only. integer 1 cents 1 to 1200 cents
bend_stepdown Pitch bend step, in cents, for downward pitch bends. integer 1 cents 1 to 1200 cents

Modulation: Envelope Generators

Opcode Description Type Default Range
egN_points N/A N/A
egN_shape N/A N/A
egN_timeX N/A N/A
egN_levelX Sets the envelope level at a specific point in envelope number N. float 0 -1 to 1
egN_shapeX N/A N/A
egN_curveX Instructs the player to use a curve shape defined under a curve header for the specified envelope segment. N/A N/A
egN_sustain N/A N/A
egN_loop N/A N/A
egN_loop_count N/A N/A
egN_volume N/A N/A
egN_amplitude N/A N/A
egN_pan N/A N/A
egN_width N/A N/A
egN_pan_curve N/A N/A
egN_freq_lfoX N/A N/A
egN_depth_lfoX N/A N/A
egN_depthadd_lfoX N/A N/A
egN_pitch N/A N/A
egN_cutoff N/A N/A
egN_cutoff2 N/A N/A
egN_resonance N/A N/A
egN_resonance2 N/A N/A
egN_eqXfreq N/A N/A
egN_eqXbw N/A N/A
egN_eqXgain N/A N/A
egN_decim N/A N/A
egN_bitred N/A N/A
egN_rectify N/A N/A
egN_ringmod N/A N/A
egN_noiselevel N/A N/A
egN_noisestep N/A N/A
egN_noisetone N/A N/A
egN_driveshape N/A N/A

Modulation: LFO

Opcode Description Type Default Range
lfoN_freq The base frequency of LFO number N, in Hertz. integer N/A N/A
lfoN_delay Onset delay for LFO number N, in seconds. float 0 seconds N/A
lfoN_fade Fade-in time for LFO number N, in seconds. float N/A N/A
lfoN_phase Initial phase shift for LFO number N. float 0 0 to 1
lfoN_count Number of LFO repetitions for LFO N before the LFO stops. integer N/A N/A
lfoN_wave LFO waveform selection. integer 1 N/A
lfoN_steps N/A N/A
lfoN_stepX N/A N/A
lfoN_smooth N/A N/A
lfoN_volume N/A N/A
lfoN_amplitude N/A N/A
lfoN_pan N/A N/A
lfoN_width N/A N/A
lfoN_freq_lfoX N/A N/A
lfoN_depth_lfoX N/A N/A
lfoN_depthadd_lfoX N/A N/A
lfoN_pitch N/A N/A
lfoN_cutoff N/A N/A
lfoN_cutoff2 N/A N/A
lfoN_resonance N/A N/A
lfoN_resonance2 N/A N/A
lfoN_eqXfreq N/A N/A
lfoN_eqXbw N/A N/A
lfoN_eqXgain N/A N/A
lfoN_decim N/A N/A
lfoN_bitred N/A N/A
lfoN_noiselevel N/A N/A
lfoN_noisestep N/A N/A
lfoN_noisetone N/A N/A
lfoN_drive N/A N/A

Curves

Opcode Description Type Default Range
curve_index integer N/A 0 to
vN float N/A 0 to 1