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 Allows the region playback to be postponed for the specified time, measured in samples (and therefore dependent on current sample rate). integer N/A N/A
delay_samples_onccN 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. float N/A N/A
md5 Calculates the MD5 digital fingerprint hash of a sample file, represented as a sequence of 32 hexadecimal digits. 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. Alias for on_loccN. Default value is -1, it means unassigned. integer -1 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. Alias for on_hiccN. Default value is -1, it means unassigned. integer -1 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. Default value is -1, it means unassigned. integer -1 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. Default value is -1, it means unassigned. integer -1 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. float filter disabled 0 to SampleRate / 2 Hz
cutoff2_onccN The variation in the cutoff frequency when MIDI continuous controller N is received. integer 0 -9600 to 9600 cents
cutoff2_curveccN integer 0 -9600 to 9600 cents
cutoff2_smoothccN integer 0 -9600 to 9600 cents
cutoff2_stepccN integer 0 -9600 to 9600 cents
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 cents
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, bpf_1p, brf_1p, apf_1p, lpf_2p_sv, hpf_2p_sv, bpf_2p_sv, brf_2p_sv, pkf_2p, lpf_4p, hpf_4p, lpf_6p, hpf_6p, comb, pink
fil2_veltrack Same as fil_veltrack, but used to specify the type for the second filter. integer 0 -9600 to 9600 cents
resonance2 Same as resonance, but used to specify the resonance for the second filter. float 0 0 to 40 dB
resonance2_onccN float 0 0 to 40 dB
resonance2_curveccN float 0 0 to 40 dB
resonance2_smoothccN float 0 0 to 40 dB
resonance2_stepccN float 0 0 to 40 dB

Performance Parameters: Pitch

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

Modulation: Envelope Generators

Opcode Description Type Default Range
egN_points N/A N/A
egN_timeX N/A N/A
egN_timeX_onccY N/A N/A
egN_levelX Sets the envelope level at a specific point in envelope number N. float 0 -1 to 1
egN_levelX_onccY 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_volume_onccX N/A N/A
egN_amplitude N/A N/A
egN_amplitude_onccX N/A N/A
egN_pan N/A N/A
egN_pan_onccX N/A N/A
egN_width N/A N/A
egN_width_onccX N/A N/A
egN_pan_curve N/A N/A
egN_pan_curveccX 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_pitch_onccX N/A N/A
egN_cutoff N/A N/A
egN_cutoff_onccX N/A N/A
egN_cutoff2 N/A N/A
egN_cutoff2_onccX N/A N/A
egN_resonance N/A N/A
egN_resonance_onccX N/A N/A
egN_resonance2 N/A N/A
egN_resonance2_onccX N/A N/A
egN_eqXfreq N/A N/A
egN_eqXfreq_onccY N/A N/A
egN_eqXbw N/A N/A
egN_eqXbw_onccY N/A N/A
egN_eqXgain N/A N/A
egN_eqXgain_onccY 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_freq_onccX N/A N/A
lfoN_freq_smoothccX N/A N/A
lfoN_freq_stepccX N/A N/A
lfoN_delay Onset delay for LFO number N. float 0 N/A
lfoN_delay_onccX N/A N/A
lfoN_fade Fade-in time for LFO number N. float N/A N/A
lfoN_fade_onccX float N/A N/A
lfoN_phase Initial phase shift for LFO number N. float 0 0 to 1
lfoN_phase_onccX N/A N/A
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_smooth_onccX N/A N/A
lfoN_volume N/A N/A
lfoN_volume_onccX N/A N/A
lfoN_volume_smoothccX N/A N/A
lfoN_volume_stepccX N/A N/A
lfoN_amplitude N/A N/A
lfoN_amplitude_onccX N/A N/A
lfoN_amplitude_smoothccX N/A N/A
lfoN_amplitude_stepccX N/A N/A
lfoN_pan N/A N/A
lfoN_pan_onccX N/A N/A
lfoN_pan_smoothccX N/A N/A
lfoN_pan_stepccX N/A N/A
lfoN_width N/A N/A
lfoN_width_onccX N/A N/A
lfoN_width_smoothccX N/A N/A
lfoN_width_stepccX 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_pitch_onccX N/A N/A
lfoN_pitch_smoothccX N/A N/A
lfoN_pitch_stepccX N/A N/A
lfoN_cutoff N/A N/A
lfoN_cutoff_onccX N/A N/A
lfoN_cutoff_smoothccX N/A N/A
lfoN_cutoff_stepccX N/A N/A
lfoN_cutoff2 N/A N/A
lfoN_cutoff2_onccX N/A N/A
lfoN_cutoff2_smoothccX N/A N/A
lfoN_cutoff2_stepccX N/A N/A
lfoN_resonance N/A N/A
lfoN_resonance_onccX N/A N/A
lfoN_resonance_smoothccX N/A N/A
lfoN_resonance_stepccX N/A N/A
lfoN_resonance2 N/A N/A
lfoN_resonance2_onccX N/A N/A
lfoN_resonance2_smoothccX N/A N/A
lfoN_resonance2_stepccX N/A N/A
lfoN_eqXfreq N/A N/A
lfoN_eqXfreq_onccY N/A N/A
lfoN_eqXfreq_smoothccY N/A N/A
lfoN_eqXfreq_stepccY N/A N/A
lfoN_eqXbw N/A N/A
lfoN_eqXbw_onccY N/A N/A
lfoN_eqXbw_smoothccY N/A N/A
lfoN_eqXbw_stepccY N/A N/A
lfoN_eqXgain N/A N/A
lfoN_eqXgain_onccY N/A N/A
lfoN_eqXgain_smoothccY N/A N/A
lfoN_eqXgain_stepccY N/A N/A

Curves

Opcode Description Type Default Range
curve_index Curve ID definition. integer N/A 0 to N/A
vN float N/A -1 to 1