Modulation/Routing
The modulation section is different from the sound generation and shaping sections as no audio data is passed through it. Instead it allows you to control the parameters in the other sections from various sources.

Routing
Modulation routing in Surge XT is a bit different compared to most synthesizers, but it’s actually very intuitive and extremely powerful, thanks to the routing bar.

How To Apply Modulation
Here’s how it works:
- Select the modulation source you want to use.

- Engage routing mode with a second click on the source. It will become bright green, and sliders that can be modulated with that source will display a blue modulation depth slider on top of their normal sliders.

- Drag the desired modulation slider (blue slider) to the position you want the parameter to be at when fully modulated (at the top peak of a Sine LFO, or after the attack stage of an envelope for example). The modulation’s full range will then be shown with the corresponding range bar indicator on the slider.

- Disengage routing mode by clicking again on the modulation source.

Alternatively, routing mode can also be engaged or disengaged by pressing the middle mouse button anywhere over the interface, or by pressing TAB on the keyboard if this option is enabled (see Workflow section in the menu). If your mouse has forward and back side buttons, those arm the modulators too.
You can also directly access the numerical modulation amount dialog (explained here) by dragging the desired modulation source over a modulatable parameter.
Note that modulation range is always relative to the base value represented by the gray slider, meaning that moving its position will then shift the whole modulation range up or down. This also means that if a modulation slider’s value is smaller than the base value, the modulation polarity will be inverted.
Also, when applying modulation to certain time-based parameters (such as Portamento, envelope attack, etc.) that are set to 0.00 seconds, in some cases, the modulation won’t trigger properly due to the way it works internally. To fix this, simply increase the parameter in question by a very small amount, just so it doesn’t have a value of 0.
Modulating a Modulator
When clicking on one of the LFO buttons in the routing bar, both the LFO source selection and the LFO editor will be selected. However, the two actions can be done separatly, as you can choose which button is selected as the modulation routing source, and at the same time edit parameters from a different LFO than the source.
To do that, select the source normally, and then click on the mini-button on another LFO (the small orange arrow):

Alternatively, you can also left-click on a modulation source while holding Ctrl/Command to display it in the LFO editor as well.
This effectively lets you modulate the parameters of one LFO with any other mod source(s). However, as an example, note that logistically, an S-LFO can modulate parameters of an LFO, but an LFO cannot modulate parameters of an S-LFO (see Voice vs Scene Modulators).
Remember that you can also see which LFO is currently being displayed in the editor by looking at what’s written vertically to the left of the editor.
Modulated Sliders
Once a slider is routed to a modulation source, the shade of blue on its tray indicates whether the parameter is modulated and by which source.

-
Parameter is not modulated (gray)
-
Parameter is modulated (gray-blue)
-
Parameter is modulated by the currently selected modulation source (bright-blue)
Moreover, if you hover your mouse pointer over any modulated slider, the source(s) it’s being modulated from will be highlighted in the routing bar. This makes it easier to see what modulation source(s) are linked to a parameter.
Modulation Source Selectors
Once routed to any parameter, the modulation source selectors change their appearance depending if they are selected, and if they are routed in the current patch or not. (scene dependent)
![]()
-
Unused modulation source
-
Used modulation source
-
Unused selected modulation source
-
Used selected modulation source
Some modulation source selectors in the routing bar have a hamburger menu. This serves as an indicator that different types of that modulation source are available. You can access them directly by clicking on that hamburger menu, by right-clicking and going into the Switch to… submenu, or simply by scrolling with the mouse wheel over the modulation source selector in question.

A modulator preset can also be loaded into the currently selected LFO modulator by dropping a .modpreset file anywhere on the Surge XT
window - see Drag and Drop.
Clearing Modulation
After right-clicking on a modulated slider, you will see an option to easily clear the modulation and un-link it from its source.

Alternatively, you can also reset its modulation slider (blue slider) to 0 by double-clicking on it when routing mode is engaged, or entering 0 in the type-in editor (see Edit Value).
Furthermore, by right-clicking on any modulation source, there will be options to clear a particular linked parameter, but also all of them at once.

Modulation List
Surge XT has a detailed modulation list that can be displayed by clicking on the vertical rectangular button at the left of the routing bar:

This panel will display the modulation routings and their amounts from both scenes in the current patch. Different display options are available to the left of its interface:
Sort by - Allows you to choose whether the list of modulations is grouped according to the source they are coming from or to the target they are routed to.
Filter By… - This option allows you to only display certain modulation routings by hiding those that aren’t included in the desired source or target in this list.
Add Modulation - These two menus allow you to directly add a new modulation routing directly from the modulation list panel. Simply select a modulation source and a modulation target to link a modulator to a parameter.
Value Display - Allows you to choose between 4 different display options regarding the modulation values displayed in the sliders section, ranging from None to Values, Depths and Ranges.
Finally, in the sliders section, you can both adjust the different modulation amounts, but also directly mute or remove a modulation routing entirely.
Modulators
Surge XT has four main types of modulation sources :
- LFOs
- Internal modulators
- Voice and note properties
- Macros
All of these modulation sources are located in the routing bar (see Routing) :


The four types of modulation sources, separated in categories.
Voice vs Scene Modulators
Some modulation sources operate at the voice level, while others operate at the scene level. Although they might seem similar, there is an important factor that distinguishes them.
On one hand, a voice modulator has separate modulation paths for each voice, meaning it can control voice-level parameters (like filter cutoff) but cannot control scene-level parameters (like FX levels or scene pitch).
On the other hand, a scene modulator has one identical modulation path for the whole scene, so it can control both scene level parameters and voice level parameters.

On top, three voice LFOs. On the bottom, three Scene LFOs, “S-” meaning Scene.
To demonstrate this distinction, let’s say an sine wave LFO is modulating the cutoff of a filter. Now, if 3 notes are being hit with a small delay between each of them, the phase of the LFO will be delayed between the notes accordingly.
You will indeed clearly hear the cutoff of the filter moving independently for each note, which gives the impression that there are three LFOs and three filters (which there actually is!). The same principle applies for envelopes.
However, unlike the first demonstration, this time, if an S-LFO is modulating a certain parameter, hitting more notes will not “add” an LFO for each voice, which gives the impression that there is a single LFO modulating the cutoff frequency of the filter instead of many.
See Modulation Routing Details in the Technical Reference section for more information.
LFOs
Unlike some other synthesizers, Surge XT does not have dedicated LFO, Envelope, Step sequencer or MSEG modulation sources. Instead, those are integrated within every LFO. This effectively enables the flexibility of having up to 12 LFOs, envelopes, step sequencers or MSEGs, and everything in between simply by changing their shape.
Surge XT’s LFOs are very flexible and come with a built in DAHDSR-envelope which can either work as a dedicated envelope generator or shape the amplitude of other modulation types over time.

Surge XT has a total of 12 LFOs:
- 6 Voice LFO sources (labeled LFO 1-6 for instance)
- 6 Scene LFO sources (labeled S-LFO 1-6 for instance)
See Voice vs. Scene for an explanation about the difference LFOs and S-LFOs.
Shapes

LFO shapes (from left to right, top to bottom):
| Sine | Sine wave LFO | Vertical bend |
| Triangle | Triangle wave LFO | Vertical bend |
| Square | Pulse wave LFO | Pulse width |
| Sawtooth | Sawtooth wave LFO | Vertical bend |
| Noise | Smooth noise LFO | Correlation |
| S&H | Sample & Hold (stepped noise) LFO | Correlation |
| Envelope | Envelope generator - sets the LFO to a constant output of 1, which can then be shaped by the LFO EG (see LFO Envelope Generator) | Envelope shape |
| Step Seq | 16 step step-sequencer (see Step Sequencer). | Smoothness/Spikyness |
| MSEG | Fully editable MSEG (Multi-Segment Envelope Generator) with a large number of curve types and various editing options (see Envelope Generator) | Depends on segment type and configuration |
| Formula | Script (Lua) enabled formula modulator | Depends on the coded modulation |
On the left, the different shapes and their explanation. On the right, the way that the Deform parameter affects the waveform.
Depending on the selected shape for a particular LFO, its name in the routing bar will change. When using the first 6 waveforms, it will be called LFO. However, when using the envelope shape, ENV will be displayed, SEQ will be displayed when the step-sequencer is used, and for the MSEG, MSEG will be displayed. Scene LFOs have their equivalent labels as well:

Parameters

Rate – Controls the modulation rate. When the type is set to Step Seq, one step equals the whole cycle. This slider can be tempo-synced and disabled from its context menu. Deactivating the rate effectively freezes the LFO to a certain constant value set by the Phase/Shuffle parameter. This can be useful for manually scrubbing in a waveform cycle of an LFO for instance, and can also be used in the same way in the sequencer. This feature can also be used to make the modulation source act as a randomizer in tandem with the “Random” trigger mode. A simpler Random (see Internal Modulators) modulation source can however also be used for that purpose. Furthermore, modulation can even be applied to the Phase/Shuffle parameter with another modulation source which opens up a lot of possibilities, such as effectively using the frozen LFO as a mod mapper.
Note: In the LFO editor, when right-clicking parameters that can be tempo-synced, there will also be an option to Tempo sync all the LFO parameters at once.
Phase/Shuffle - Controls the starting phase of the modulation waveform. As with any parameter, it can be modulated. However, in this case, its modulated value will not change after the modulation is triggered (for instance, it’s not possible to shift an LFO’s phase while a note is pressed). Only starting phase is taken into account.
In Step Seq mode the parameter acts as shuffle instead, and can be extended from its context menu for bipolar shuffle, useful for adding swing to the sequencer.
Amplitude – Controls the amplitude of the modulation. This is the parameter you should use if you want to control the depth of an LFO with a controller (like controlling vibrato depth with the modulation wheel, for instance). This control can also be extended form its context menu, which allows you to reach a negative amplitude range (-100 to 100% instead of 0 to 100%).
Deform – Deform the modulation shape in various ways. The effect varies depending on the selected shape. Different deform types are available for the Sine, Triangle, Sawtooth, S&H, Envelope and Step Seq shapes, and can be accessed by right-clicking on the Deform slider.
Trigger mode – Chooses how the LFO is triggered when a new note is played:
- Freerun – The LFO’s starting phase is synchronized with the host’s song position to make it continuously running in the background. The modulation will be trigged at its starting phase when playback position is either at the beginning position and the song starts playing, or when playback position goes back at the beginning of a loop for instance. Freerun behaves the same on voice LFOs or scene LFOs.
- Keytrigger – The LFO’s starting phase is triggered when a new note is pressed. If the synth is set to “Poly”, each new voice gets its own LFO triggered with it when using a voice LFO. However, when using an scene LFO, the first voice sets the LFO’s position, then the other ones will follow it.
- Random – The LFO’s starting phase is set to a random point in its cycle. If the synth is set to “Poly”, each new voice gets its own LFO triggered with it when using an voice LFO. However, when using an scene LFO, the first voice sets the LFO’s position, then the other ones will follow it.
For scene LFOs only, the right-click menu of the trigger mode control offers one further option:
- Retrigger on New Note – Normally a scene LFO is triggered by the first note of a phrase and then left to run, so notes played while others are held do not disturb it. With this enabled, every new note retriggers the LFO. Voice LFOs already behave this way, which is why the option is not offered for them.
Note that the Deform slider and several other parameters can be renamed by a Formula modulator. If you find a slider with an unfamiliar name, see the labels table under Formula.
Unipolar - If active, the modulation will be in the [0 .. 1] range (unipolar). If not, it will be in the [-1 .. 1] range (bipolar).
The modulation range on a parameter is represented by a green bar when routing mode is engaged (see Routing).

Modulation on a control from a bipolar source

Modulation on a control from a unipolar source
LFO Envelope Generator
The Envelope Generators are of the 6-stage DAHDSR type that are multiplied with the waveform generator, no matter what the selected LFO shape is. This means that if the LFO shape is set to Envelope, the output will simply be 100%, and can then be shaped by the LFO EG.
Also, note that when using the Envelope shape, the envelope will always trigger on key trigger, no matter what the trigger mode is set to.
The LFO envelope generator can be completely disabled by right-clicking on one of its controls and unchecking the Enabled option.


6-stage DAHDSR envelope
Step Sequencer
The Step Seq shape houses a step sequencing editor where the LFO display would be. It allows you to draw the output waveform with up to 16 steps.

Step Sequencer editor
The two blue markers define loop-points in which the sequence will repeat once it gets into the loop. The left mouse button is used for drawing while the right one can be used to clear the values to zero.
To quickly reset a step to 0, either double-click on a step, or hold down Ctrl/Command and click or drag with the mouse over the desired step(s).
Right-clicking and dragging over steps allows you to draw a straight line over the desired steps, thus creating a perfectly linear staircase pattern.
Holding down Shift while drawing will quantize the values to the scale degrees (1/12th in case of standard tuning, or possibly other for custom tuning) spanning the range of one octave. Furthermore, holding down Shift + Alt/Option makes two times more values available, hence useful when modulating pitch by two octaves instead.
For more information on microtonal pitch modulation using the step sequencer, visit our Tuning Guide.
The step sequencers inside voice LFOs have an extra lane at the top of the step editor allowing to re-trigger the two regular voice envelopes (The Amplifier and Filter Envelope Generators) when the small rectangle is filled at that particular step.

Step Seq of LFO 1 containing the re-trigger pane
However, shift-clicking or right-clicking those rectangles allows the specified step in the sequencer to only trigger one of the two envelopes. When the step is half-filled on the left, only the filter envelope will be triggered. When filled on the right, only the amplifier envelope will be triggered.

The Deform parameter gives the Step Seq waveform a lot of flexibility. A value of 0% will output the steps just as they look on the editor. Negative values will give an increasingly spiky waveform while positive values will make the output smoother.
| Negative deform | ![]() |
| Positive deform | ![]() |

Effect of the deform parameter on the step Seq waveform
Multi-Segment Envelope Generator
Surge XT’s Multi-Segment Envelope Generator (MSEG) is powerful and fully editable with a large number of curve types and various editing options. It can be used to create more complicated LFO waveforms or envelopes compared to the previously mentioned modulation shapes. With the combination of various settings in the editing window and the usual parameters from the LFO editor, you can practically create any modulation shape you could think of.

To open this MSEG editing window, you can either click on the little pencil button next to the wave display (1), click on the wave display itself (2), or double-click on the MSEG icon in the modulation type selector (3):

Default MSEG state
Once opened, you will see a shape working as an envelope if you’re using a voice LFO, or a triangle wave working as an LFO if you’re using a scene LFO. In any case, you can either build upon these shapes if they suit your needs, or you can reset them to a simple straight line by right-clicking anywhere in the edit window, then choosing Create -> Minimal MSEG. More information on those menu entries can be found below.

Zooming and panning
In the MSEG editor, you can pan the view left or right by either left-clicking or middle-clicking, then drag on the background left or right.
You can also zoom in and out by either scrolling with the mouse wheel or left-clicking then dragging your mouse up or down. Alternatively, you can again middle-click and drag if you prefer.
Moving nodes
To move a node, simply left-click and drag it. To do the same with multiple nodes at the same time, you can Shift + left-click and drag, which makes a selection.
Adding and removing nodes
In Surge XT’s MSEG, a segment is comprised of its starting node (point) and the segment itself. A “segment’s end node” is actually the next segment’s starting node. To add a new node, simply double-click where you want it to be added. To remove a node and its following segment, simply double-click on the node you want to remove. Note that you can only remove nodes if there are more than two nodes remaining in the shape.
Control points
In addition, you will also often find a control point in the middle of a segment. This one can be dragged vertically (and also sometimes horizontally) to alter the segment’s curvature or other properties depending on the line type. To reset a control point to its default position, simply double-click on it.
Further gestures
-
Shift + mousewheel over a segment cycles through the segment types, making it a quick way to audition various types without going through the context menu each time.
-
Ctrl/Command + Shift + drag draws a zoom lasso: the area you drag out becomes the new view. The cursor changes to an I-beam while you do this, where an ordinary selection lasso shows a crosshair.
-
Ctrl/Command + Shift + Alt/Option + drag draws freehand, and Surge XT fits a curve through what you drew.
See also MSEG Editor Keyboard Navigation for controlling the MSEG editor entirely from the keyboard.
MSEG editing and behavior options
At the bottom of the editor are a couple of options to configure editing modes and general behavior of the MSEG:
-
Movement Mode - Sets the behavior when moving nodes.
- Single - When dragging a node horizontally, moves a single node without affecting the others.
- Shift - When dragging a node horizontally, shifts around the nodes following the node being moved, keeping the length of the segment belonging to that node constant.
- Draw - Locks horizontal dragging of nodes, allowing you to draw over existing nodes to set their value in a simple sweeping motion.
-
Edit Mode - Configures the MSEG editor to work in Envelope or LFO mode.
- Envelope - Displays draggable loop points and region (effectively representing the Sustain stage in an envelope).
- LFO - Hides the draggable loop points and region, links the value of the start and end nodes to complete the waveform cycle, always keep loop mode enabled (even if set to off).
-
Loop Mode
- Off - Don’t loop when in Envelope mode, turn off draggable loop points.
- On - Loop forever in the loop region (between the loop points). Subsequent segments, if any, will never be reached.
- Gate - Loop until the note is released, then immediately transition to the segments following the loop region.
-
Snap To Grid
- Horizontal - Enables horizontal snapping to the grid. The number field to the right corresponds to the horizontal grid resolution. You can also temporarily enable horizontal snapping by holding down the Ctrl/Command key while dragging.
- Vertical - Enables vertical snapping to the grid. The number field to the right corresponds to the vertical grid resolution. You can also temporarily enable vertical snapping by holding down the Alt/Option key while dragging.
-
Selected Node - Selects a node by number, which is mostly useful for reaching a node from the keyboard, or for seeing which node the editor currently considers selected.
-
Deform - Use and Invert toggles for the selected nodes, the same settings that the segment context menu offers as Use Deform for Segment and Invert Deform Value.
-
Trigger EG - Filter and Amp toggles for the selected nodes, matching the Trigger entries in the segment context menu. These are not available for scene LFOs.
Segment options
Each segment has options in a context menu which can be accessed with a right-click in the area of that segment. Some of them are only applied to the right-clicked segment, while others are applied to the whole shape:
-
Actions
- Split - Splits the segment into two by adding a new node in its center
- Delete - Remove the segment and its starting node
- Double duration - Doubles the total duration of the whole shape
- Half duration - Halves the total duration of the whole shape
- Flip vertically - Flips the whole shape vertically
- Flip horizontally - Flips the whole shape horizontally
- Quantize notes to snap division - Quantizes the nodes in the whole shape to the nearest horizontal grid position. Available in Envelope edit mode only.
- Quantize notes to whole units - Quantizes the nodes in the whole shape horizontally to the nearest whole time units. Available in Envelope edit mode only.
- Distribute nodes evenly - Distributes the existing nodes from the whole shape evenly in the horizontal axis between the first and last node.
-
Create
- Minimal MSEG - Loads a straight line going from 1 to 0 in value, a great starting point to build upon.
- Default voice MSEG - Loads the default voice MSEG preset (envelope shape).
- Default scene MSEG - Loads the default scene MSEG preset (triangle wave LFO shape).
- 8 to 128 step sequencer - Replaces the existing shape by an 8 to 128-step sequencer shape.
- 8 to 128 sawtooth plucks - Replaces the existing shape by an 8 to 128 sawtooth plucks shape.
- 8 to 128 lines sine - Replaces the existing shape by a sine wave made out of 8 to 128 segments.
-
Trigger
- Filter EG - Triggers the hardwired filter envelope generator at that point.
- Amp EG - Triggers the hardwired amplifier envelope generator at that point.
- Nothing - Disables the triggering of both the filter and amplifier envelope generators at that point.
- All - Enables the triggering of both the filter and amplifier envelope generators at that point.
-
Settings
- Link Edge Nodes - Links the value of the start and end nodes (useful for seamless looping).
- Use Deform for Segment - Sets if the selected segment is affected by the Deform parameter found in the LFO editor or not (see deform parameter).
- Invert Deform Value - Inverts the deform polarity applied to the selected segment.
-
Type-in entries - The menu also lists the values of the segment you right-clicked, each of which can be typed in directly: Duration, Value, “Control Point” for segment types that have it, and for segments that have a two-dimensional control point, Control Point X and Control Point Y.
-
Set Loop Start / Set Loop End - Available when you right-click a node, these set the loop boundaries without dragging the loop markers.
-
Segment types - List of line types from which a segment can be. The control point, if present, will have a different effect depending on the type used. The menu groups them as below.
- Hold - Holds the value of the previous node up to the segment’s end node. No control point available.
- Linear - Single line. The control point controls the curvature of the segment.
- S-Curve - Curved line. The control point determines how abrupt the S-shape is and its direction.
- Bezier - Single line. The control point can freely bend the segment.
- Sine, Triangle, Sawtooth, Square - Sine, triangle, sawtooth or square waves. The control point determines how many wave cycles there are between the segment’s beginning and end node.
- Ratchet 1 to Ratchet 8 - A capacitor-charge curve, repeated that many times within the segment. The two-dimensional control point scales the peak of each repeat by using a two-part envelope across the segment: the control point’s horizontal position is the breakpoint and its vertical position the value there, so you can make the ratchets rise, fall, or peak in the middle. The Deform parameter sets how sharply each repeat decays.
- Bump - Single line. The control point can be moved up or down to create a “bump” in the segment.
- Stairs, Smooth Stairs - Stair or smooth stairs line types. The control point determines how many steps there are between the segment’s beginning and end node.
- Brownian Bridge - Random between the beginning and end node every time it’s being triggered. Moving the control point down adjusts the number of steps while quantizing them up to 24 equidistant steps (useful for random scales, for instance). Moving the control point up also adjusts the number of steps, but this time without any quantization. The horizontal value of the control point adjusts correlation.
Formula
The Formula modulator shape is a fully-fledged and Lua-enabled scriptable modulation source. Although this shape may not be as straight forward to use and to understand as the others listed above, in its complexity hides true modulation power, which technically-geared users will truly appreciate.
Surge XT comes with a series of tutorials for the formula modulator available in the patch browser, each of them explaining different aspects and ideas you can re-create in the formula editor:

These tutorials are definitely worth consulting, but here are some basic principles that may help you get started with the formula modulator.
Every formula modulator instance must contain at least a process function. This is where the modulator output will be set or calculated.
Different variables can be accessed (and some modified), allowing you to create the desired modulation behavior:
| amplitude | Value of the modulator’s Amplitude parameter | Ranges from 0 to 1 or -1 to 1 |
| attack | Value of the modulator’s Attack parameter | Ranges from 0 to 1 |
| block_size | Audio buffer size used by Surge XT | |
| cc_breath | Breath controller signal | Ranges from 0 to 1 |
| cc_expr | Expression controller signal | Ranges from 0 to 1 |
| cc_mw | Modulation wheel value | Ranges from 0 to 1 |
| cc_sus | Sustain pedal value | Toggles between 0 or 1 |
| chan_at | Monophonic aftertouch if MPE is disabled | Ranges from 0 to 1 |
| clamp_output | Can be set to false to disable the output range limit | |
| cycle | Alias for intphase | |
| decay | Value of the modulator’s Decay parameter | Ranges from 0 to 1 |
| deform | Value of the modulator’s Deform parameter | Ranges from 0 to 1 |
| delay | Value of the modulator’s Delay parameter | Ranges from 0 to 1 |
| highest_key | Keytrack value corresponding to the highest note played | +1/-1 per octave centered at middle C |
| hold | Value of the modulator’s Hold parameter | Ranges from 0 to 1 |
| intphase | Integer value set to the number of cycles that have been executed | |
| is_playing | Is set to true when the plugin host (DAW) is playing. Always true in standalone | |
| is_rendering_to_ui | Is set to true if the call is used to update the graph in the UI | |
| is_voice | Is set to true when the modulator is a voice modulator | |
| labels | Optional table for renaming the Rate, Phase, Deform and Amplitude sliders, set in init | See below |
| latest_key | Keytrack value corresponding to the latest note played | +1/-1 per octave centered at middle C |
| lowest_key | Keytrack value corresponding to the lowest note played | +1/-1 per octave centered at middle C |
| lfo_id | Index number of this Formula’s LFO slot | 1-6 for voice, 7-12 for scene LFOs |
| macros | See tutorial Macros And Voice Parameters (#6) | |
| mpe_bendrange | MPE Pitch bend range | Set in the MPE menu |
| mpe_enabled | Is set to true if MPE is enabled in the MPE settings sub-menu | |
| output | Output value of the Formula modulator itself (see also clamp_output) | Outputs between -1 and 1 by default |
| pb | Current value of pitch bend | Ranges from -1 to 1 |
| pb_range_dn | Pitch bend down range | Set as Bend Depth in the UI |
| pb_range_up | Pitch bend up range | Set as Bend Depth in the UI |
| phase | Continuous value representing the real-time phase position of the modulator output | Cycles from 0 to 1 |
| play_mode | Play mode | |
| poly_limit | Polyphony limit | |
| rate | Value of the modulator’s Rate parameter | Ranges from -7 to 9 |
| release | Value of the modulator’s Release parameter | Ranges from 0 to 1 |
| released | Is set to true when the voice is in the release state | |
| retrigger_AEG | Can be set to true to trigger the Amplitude EG | |
| retrigger_FEG | Can be set to true to trigger the Filter EG | |
| samplerate | Host sample rate | |
| scene_mode | Scene mode | |
| songpos | Host song position | |
| split_point | Note or channel split point (depending on Scene mode) | |
| startphase | Value of the modulator’s Phase slider | Ranges from 0 to 1 |
| subscriptions | Deprecated in Surge XT version 1.4.0 | |
| sustain | Value of the modulator’s Sustain parameter | Ranges from 0 to 1 |
| tempo | Host tempo | |
| tuned_key | Key that triggered the modulator, modified by the current tuning | In semitones |
| use_amplitude | Set to false to disable the Amplitude slider scaling the output | |
| use_envelope | Set to false to disable the LFO Envelope Generator shaping the modulator output | |
| use_rate | Set to false to disable the ghost waveform in the LFO display when the Rate slider is disabled | |
| voice_count | Number of currently active voices | |
| voice_id | Order in which this voice was created |
In addition to the list above, Formula voice modulators also have access to these variables:
| channel | MIDI/MPE channel that triggered the modulator | |
| key | Key that triggered the modulator | MIDI note number |
| mpe_bend | Current MPE Pitch bend value | Ranges from -1 to 1 |
| mpe_pressure | MPE Pressure | Ranges from 0 to 1 |
| mpe_timbre | MPE Timbre | Ranges from 0 to 1 |
| poly_at | Per note polyphonic aftertouch | Ranges from 0 to 1 |
| rel_velocity | Per note release velocity value | Ranges from 0 to 127 |
| velocity | Per note velocity value | Ranges from 0 to 127 |
You can access or modify these values by using the following syntax:
local v = state.*variable-name* -- accessstate.*variable-name* = <value> -- modifyThe shared table
Separately from state, there is a global table called shared. Unlike everything in the table above, it is not
per-voice nor per-modulator: every Formula modulator in the patch, on every voice, sees the same shared table.
Being a plain Lua global, it is read and written as shared.my_value rather than state.shared. This is how one
Formula can pass information to another, or how a voice modulator can accumulate something across all the voices.
The debugger
To see the values of these variables, open the integrated debugger by clicking the Show Debugger button at the bottom right of the editor. The debugger also allows you to initialize the modulator by clicking on Init, and to step through the code using the Step button.
Variables in the debugger are grouped into collapsible sections - User Variables for anything your own script
has put onto the state table, Shared for the contents of the shared table, and Built-in Variables for the ones
Surge XT provides.
Multiple outputs
Since Formula is an indexed modulator, you can have up to 16 different outputs on a single formula modulator instance. This can be done by assigning the output to an array of values instead of a single value. An example of this can be seen in the tutorial 10 Example - Both Time And Space.
Custom names given to these outputs are stored in modulator presets, not just for Formula modulator. LFOs can be renamed as well.
A Formula modulator can also rename the four main LFO sliders. Assigning a labels table in the modulator’s init function changes the default Rate, Phase, Deform and Amplitude names, both on the sliders and in the modulation matrix. Every entry is optional, so any slider you leave out keeps its default name:
function init(state) state.labels = { rate = "Foo", phase = "Bar" } return stateendAfter entering code or modifying existing code, press the Apply button for changes to take effect. You will see the output display update with the new shape. Applying also trims trailing whitespace from your code. If you close the editor through a keyboard shortcut while changes are still unapplied, Surge XT asks for confirmation first, rather than discarding them.
Finally, you can switch to the Prelude view of the code by clicking on the corresponding button. The Surge
prelude is loaded in each surge session and provides a set of built in utilities we’ve found handy in writing
modulators. Its helpers live in the math and mod tables, so they are called as math.linspace(...) and
mod.pb_to_st(). Among them are:
- Conversions and ranges:
math.clamp(also available asmath.limit_range),math.rescale,math.norm,math.range,math.lin_to_dB,math.dB_to_lin,math.note_to_freq,math.freq_to_note. - Table builders and maths:
math.linspace,math.logspace,math.cumsum,math.cumprod,math.full,math.zeros,math.ones,math.offset,math.max_abs,math.sinc,math.gcd,math.lcm,math.parity,math.sgn. - Random distributions:
math.random_normal,math.random_poisson,math.random_exponential,math.random_bernoulli. - Modulation helpers:
mod.pb_to_st,mod.cosine_fade, and themod.ClockDivider,mod.AHDEnvelopeandmod.Slewobjects.
Scripts run in a sandbox, so only a subset of Lua is reachable. Alongside the math, string, table and
bit libraries, the sandbox provides pairs, ipairs, unpack, next, type, tostring, tonumber,
setmetatable, pcall, xpcall and error, plus print for writing to the console.
Toggleable actions such as clamp_output and use_envelope accept 0 and 1 as well as false and true.
The Code Editor
The Formula editor and the Wavetable Script Editor share the same code editor, so everything described here applies to both.
Finding your way around the text:
- Ctrl/Command + F opens find, Ctrl/Command + H opens find and replace, and Ctrl/Command + G goes to a line number. All three are also on the editor’s menu.
- Selecting some text highlights every other occurrence of it, as do search matches and the line the caret is on, which makes it easy to see where a variable is used.
- Double-click selects a word, triple-click selects the line, and clicking a fourth time selects the whole script.
- Shift + mousewheel scrolls horizontally. Dragging a selection past the edge scrolls and extends the selection at the same time.
Typing assistance:
- Lines are indented automatically after
function,whileandif, and a new line keeps the indentation of the one above it. - Tab always indents at the caret, and indents the whole selection when there is one. Backspace removes one level of indentation at a time rather than one space.
- Brackets, parentheses, braces and quotes are auto-inserted in pairs, and typing one of them with text selected encloses the selection instead of replacing it.
Other behavior:
- Syntax highlighting has several color schemes to choose from, and multiline comments are highlighted correctly.
- Undo and redo follow whatever you have bound in the Keyboard Shortcut Editor.
- The editor remembers its state - caret position, selection, and the contents of the find, replace and
go-to-line fields - when it loses focus. Loading a
.modpreset,.wtscriptor.fxpclears it, since the text it referred to is gone.
The Prelude differs between the two editors: the Formula prelude and the wavetable prelude are separate libraries with different helpers. The debugger described above is Formula-only; the Wavetable Script Editor has Apply and Generate in its place.
LFO Presets
To the left of the Rate parameter, a small menu icon can be found. Clicking on it will reveal options to save the selected LFO state, open previously saved states, and finally Refresh Presets to update the list. Presets will be categorized by modulation shape, and the menu separates them into FACTORY PRESETS and USER PRESETS sections.
When saving, the current name of the LFO is offered as the suggested filename. Presets store any custom names you have given the modulator and, for Formula, its outputs.
.modpreset files can also be loaded by dropping them anywhere on the Surge XT window - see
Drag and Drop.
Raw Waveform and EG Only Outputs
Each LFO is comprised of three distinct modulation outputs: the full LFO, the raw waveform, and the envelope generator only.
While the full LFO output (default) will send the resulting LFO shape modulated with the integrated envelope generator, switching to Raw Waveform from the modulation source context-menu will bypass the envelope, and Envelope Generator Only will set aside the LFO shape itself and only produce an output from the envelope generator. Those three outputs are treated as three separate modulation sources.
Right below, there is an option to apply the Amplitude parameter to still affect the Raw Waveform and Envelope Generator Only outputs of that modulator.
Copy/Paste Options
Finally, after setting up an LFO, its settings with or without its targets can be copied and pasted to another LFO. To do this, simply right-click on the source LFO in the routing bar and use the desired Copy option, depending on what you want to replicate on the new modulation source. Then, use the Paste option to paste it.
Renaming
LFOs and S-LFOs can be renamed to be more representative of their role and to help the user keep track of what each modulation source is doing in a patch. To do this, simply right-click on the LFO or SLFO in question, select Rename Modulator… and enter the desired name.
For more information on LFO algorithms, see LFOs in the Technical Reference section.
Internal Modulators
Filter EG
The Filter Envelope Generator modulation source, which is labeled “Filter EG”, is simply a modulation source corresponding to the output of the Filter EG, which as its name suggests is already hardwired to the filter modules. Other parameters can also be modulated by the Filter EG by various amounts, simply by routing them to this source.
Amp EG
The Amp EG modulation source, which is labeled “Amp EG”, is simply a modulation source corresponding to the output of the Amp EG, which as its name suggests is already hardwired to the output amp module. Other parameters can also be modulated by the Amp EG by various amounts, simply by routing them to this source.
Random
This modulation source operates at voice level. It will generate a single random value inside the modulation range for each voice every time a voice is played.
By default, this modulation source is bipolar and its value distribution is uniform. However, you can switch to a unipolar and normal versions of it by right-clicking on it and selecting Switch to…, and then choosing the desired type from the list. All of those can be used at the same time, so they can be considered independent modulation sources.
Note that multiple parameters routed to that modulation source will all receive the same value (in percentage). To send different randomized values to different parameters, multiple LFOs can be configured in a way to do this and with greater control. See the explanation of the Rate parameter.
Alternate
This modulation operates at the voice level. It will generate alternating values between the two modulation range’s extremums.
By default, this modulation source is bipolar. However, you can switch to a unipolar version of it by right-clicking on it and selecting Switch to -> Alternate Unipolar. The two can also be used at the same time, so they can be considered two independent modulation sources.
Voice and Note Properties
Like other synthesizers, Surge XT receives MIDI data to determine what note(s) to play. However, it can also use MIDI CC data to modulate any routable parameter.
There are 14 of those voice and note properties in the routing bar:
| Velocity | Per note velocity amount | Voice modulator | Unipolar |
| Release Velocity | Per note release velocity amount | Voice modulator | Unipolar |
| Polyphonic Aftertouch (labeled Poly AT) | Per note polyphonic aftertouch | Voice modulator | Unipolar |
| Channel Aftertouch (labeled Channel AT) | Monophonic aftertouch if MPE is disabled | Scene modulator, Voice modulator in MPE mode |
Unipolar |
| Pitch Bend | Pitch bend wheel value | Scene modulator | Bipolar |
| Modwheel | Modulation wheel value | Scene modulator | Unipolar |
| Breath | Breath controller signal | Scene modulator | Unipolar |
| Expression | Often used in pedals and for crescendos or decrescendos | Scene modulator | Unipolar |
| Sustain | Sustain signal, often from a pedal | Scene modulator | Unipolar |
| Timbre | Primarily used for MPE controllers | Voice modulator | Bipolar by default, configurable |
| Keytrack | Per note keytrack value | Voice modulator | Bipolar |
| Lowest Key | Keytrack value corresponding to the lowest note played | Scene modulator | Bipolar |
| Highest Key | Keytrack value corresponding to the highest note played | Scene modulator | Bipolar |
| Latest Key | Keytrack value corresponding to the latest note played | Scene modulator | Bipolar |
Timbre is bipolar by default, but can be switched to unipolar from the MPE Timbre Range entry in the MPE Settings menu, or from the right-click menu of the Timbre modulation source itself.
The Sustain source’s right-click menu offers Detach Sustain Pedal from Voicing, which stops the sustain pedal from holding notes and leaves it as a pure modulation source. This is a patch-wide setting, affecting both scenes, and is useful when you want the pedal to control something other than note length.
Note that only scene-level modulation sources can be routed to FX sends and parameters. For instance, you can use Latest Key instead of Keytrack to modulate FX parameters, as Keytrack is a voice-level modulation. See Voice vs. Scene modulators for more details.

Macros
There are 8 macros, and by default, they are blank.
What separates these assignable controllers from the rest is that with a right-click, they can be assigned to a MIDI controller or any MIDI CC signal, and their value can be edited on-screen with the blue digital slider below their names.
By default, the macros are assigned to midi CC 41-48, which is often mapped by default to knobs or slider banks for a lot of midi controllers.
See MIDI CC Information in the Technical Reference section for more information.
The right-click context menu also allows you to rename the controller. There is also the typical routing and clearing options, (see Routing) and you can choose if their modulation is bipolar (both positive and negative with 0 in the middle) or unipolar (just positive).
Macros can also be dragged and dropped over other macros to make them switch place. To do so, simply left-click + drag over the desired macro slot location.
Finally, note that macros are considered global modulators, meaning they are shared between and act on both scenes A and B. This is useful in case you would want to quickly control certain parameters from both scenes in a single place.
Note: macro values are always available to Formula modulators through the macros table. Earlier
versions required a Formula to subscribe to the macros it wanted to read; that mechanism is deprecated as of
Surge XT 1.4 and no longer necessary.

