Skip to content

SFZ v2 Opcodes

The SFZ v2 standard has never been clearly set down anywhere. For the purpose of this website, anything included in the SFZ v2 regression tests or mentioned in the Cakewalk book is considered SFZ v2, and anything not there is considered an extension. If something works in a Cakewalk product, such as Rapture, but is not mentioned in the book, that’s considered a Cakewalk extension.

The book is not recent, and was not intended to be a standards document, but rather a manual for users of Cakewalk products. So, if you are developing a new SFZ player, do not feel obligated to support all opcodes in this list - instead, use your judgment.

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
direction The direction in which the sample is to be played. string forward forward, reverse
loop_count The number of times a loop will repeat. integer N/A N/A
loop_crossfade Loop cross fade. float N/A N/A
loop_type Defines the looping mode. string forward forward, backward, alternate
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 N is between reverse_loccN and reverse_hiccN, the region plays reversed. integer N/A 0 to 127
reverse_hiccN If MIDI CC N 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 N, 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. integer N/A N/A
note_polyphony Polyphony limit for playing the same note repeatedly. integer N/A N/A
note_selfmask Controls note-stealing behavior for a single pitch, when using note_polyphony. string on on, off
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
sostenuto_sw Turns the sostenuto switch on or off. string N/A on, off
sustain_sw Turns the sustain 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
sw_default Define keyswitch 'power on default' so that you hear something when a patch loads. integer N/A 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: Amplifier #

Opcode Description Type Default Range
phase If invert is set, the region is played with inverted phase. string normal normal, invert
pan_keycenter Center key for pan keyboard tracking. integer 60 0 to 127
pan_keytrack The amount by which the panning of a note is shifted with each key. float 0 -100 to 100 %
pan_veltrack The effect of note velocity on panning. float 0 -100 to 100 %

Performance Parameters: EQ #

Opcode Description Type Default Range
eqN_type Sets the type of EQ filter. string peak peak, lshelf, hshelf

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 N/A 0 to 255
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 Filter type. 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 integer N/A 0 to 255
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_smooth Pitch bend smoothness. Adds “inertia” to pitch bends, so fast movements of the pitch bend wheel will have a delayed effect on the pitch change. float 0 0 to 100 %
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 float N/A N/A
egN_timeX_onccY float 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. float 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 N/A N/A
lfoN_steps Number of steps in LFO step sequencer. integer N/A N/A
lfoN_stepX Level of the step number X in LFO step sequencer. float N/A -100 to 100 percent
lfoN_stepX_onccY 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
vN float N/A -1 to 1

Effects #

Opcode Description Type Default Range
bus The target bus for the effect. string main main, aux1, aux2, aux3, aux4, aux5, aux6, aux7, aux8, fx1, fx2, fx3, fx4, midi
effect3 Gain of the region's send into the 3rd effect bus. float 0 0 to 100 %
effect4 Gain of the region's send into the 4th effect bus. float 0 0 to 100 %
type Effect type or vendor-specific effect name. Varies across SFZ players. string N/A apan, comp, delay, disto, eq, filter, fverb, gate, limiter, lofi, mverb, phaser, static, strings, tdfir, com.mda.Limiter, com.mda.Overdrive, com.mda.Leslie, com.mda.RingMod, com.mda.Delay, com.mda.Bandisto, com.mda.Ambience, com.mda.DubDelay, com.mda.Detune, com.mda.Dither, com.mda.Combo, com.mda.Degrade, com.mda.SubSynth, com.mda.RezFilter