Modulation changes another opcode’s value, “either at the time the region is triggered, or in real time whilst the region is playing” (modulations/index.md). These notes are in our words, from the docs/modulations/ pages of the sfz-format repository (sfzformat.com); the names and ranges are in the tables on the opcode pages.
The sources
- MIDI controllers, written
_ccN,ccNor (SFZ 2)_onccNafter the target:width=0 width_cc12=100opens the width from 0 to 100 with controller 12. The amount is in the units of the target and “the range usually allows the full amount of the target opcode to be reversed”;cutoffis the exception, where the type and units differ. - Envelope generators and LFOs (below).
- Key tracking and velocity tracking:
_keytrackfor the note number and_veltrackfor the velocity, on amplifier (amp), filters (fil,fil2), pan, pitch (pitchortune) and the stereo position.amp_veltrackcan also be changed by a controller (_ccN), a curve (_curveN) or a random amount (_random) (modulations/keytrack_veltrack.md). - Channel aftertouch and polyphonic aftertouch: the suffixes
chanaftandpolyaft, for_depthand_freqofamplfo,fillfoandpitchlfoand forcutoffandcutoff2(with an extra underscore:cutoff_polyaft). Channel aftertouch acts on all voices of the channel, polyphonic aftertouch on the voices of one note, and “depending on implementation, Polyphonic Aftertouch may or may not be fully implemented” (chanaft_polyaft.md). - Note velocity into the parameters of an envelope or an equaliser:
(param) = (eg type)_(param) + ((eg type)_vel2(param) * velocity / 127)forampeg,filegandpitcheg, and the same for the EQ bands (eq1_vel2freq,eq1_vel2gain) (modulations/vel2.md).
Curve, smoothing and steps of a controller
curveccN“designates a <curve> which shapes the controller input. If absent, the default curve is used, a straight line which runs from 0 to 1.” Its value is thecurve_indexof a built-in or user-defined curve (Headers).smoothccN“sets the smoothness for the target modulation in milliseconds”. It adds inertia: fast controller movement has a delayed, smoothed effect. The default is 0 ms. SFZ 2 sets no limit on the targets, but ARIA smooths only pitch-related and volume-related targets (amplitude, pan, position).stepccN“sets the interval between consecutive steps. If this is not used, there are 127 modulation steps”:pitch_oncc16=1200 pitch_stepcc16=300gives five positions, 0, 300, 600, 900 and 1200 cents.icurveccN((target)_icurvecc) is a deprecated ARIA extension that chose whether a curve gave fractional or whole numbers; “in later versions of ARIA, fractional values are always used”.
Controller 0 cannot be used, and the controllers 128 and above are on Extended MIDI controllers.
Envelope generators
Traditional (SFZ 1): ampeg, pitcheg and fileg, six stages in order, delay, attack, hold, decay, sustain and release, with the times in seconds. sfzformat.com says that “at least the ARIA Engine and sfizz” use these curves: attack linear (convex in dB), decay and release convex (linear in dB). ARIA can change the shape of each stage with opcodes such as ampeg_attack_shape: 0 is linear, positive values are concave and negative values convex. The decay stops when it reaches the sustain level.
Flexible (SFZ 2): egN_…. Each has numbered points with a time (seconds from the previous point) and a level (a multiplier of the full depth), an optional sustain that names the point that holds while the key is down, and a destination:
eg01_pitch=1200
eg01_time1=0 eg01_level1=0
eg01_time2=1 eg01_level2=1
eg01_time3=2 eg01_level3=0.5 eg01_sustain=3
eg01_time4=1 eg01_level4=0
The pitch rises 1200 cents in a second, falls to half of that over two seconds, stays there while the note is held, and returns to the original pitch in a second after release. Unlike the traditional decay, a flexible envelope always scales over the full duration of a stage. The default shape of its stages is linear; eg01_shape2=-10.36 bends the stage that ends at point 2 to match the convex curve of the SFZ 1 decay and release, and a shape of 6 or -6 approximates a SoundFont curve. To replace the SFZ 1 amplitude envelope use eg01_ampeg=100 rather than eg01_amplitude=100. The range of the depth depends on the target: for pitch, -9600 to 9600 cents, “implementation dependent”.
The envelope opcodes are on Envelope generators.
LFOs
LFOs “are triggered by note-on events for the specified region”; there are no free-running LFOs in the specification. SFZ 1: amplfo, fillfo and pitchlfo with _delay, _fade, _freq, _depth and their controller and aftertouch forms. SFZ 2: assignable lfoN_… with wave, freq, delay, fade, phase and count, and the destinations added as a suffix: lfo01_pitch=100 sends LFO 1 to the pitch with a depth of 100 cents, and lfo03_freq_lfo01=1.3 lets LFO 3 add up to 1.3 Hz to the frequency of LFO 1 (loops are possible). Other destinations are decim, bitred, cutoff, resonance, cutoff2, resonance2, the equaliser bands, volume, amplitude, pan and width, each with _oncc, _smoothcc and _stepcc forms. In ARIA, lfo03_freq_lfo01_oncc117 lets a controller set the amount. In the Cakewalk products one LFO that modulates another with a lower number takes effect at once, and with a higher number at the next frequency update, which keeps feedback under control.
The LFO opcodes are on LFOs.