What are sub controls?
Sub controls provide a more customized user interface than standard controls but require more expertise to use effectively. They provide a lower-level access to the various visual elements on your control panel. Before sub-controls, SynthEdit provided only pre-made controls, like the Slider Control. Now we have a range of modules grouped under the category of “Sub-Controls that we can use to create our own customized controls.
How sub-controls work.
To understand sub-controls, it’s good to have some background on how these particular controls work.
Although you can’t see them, a slider (unlike the Knob control a slider can’t be opened up to see its structure) has several interacting components… Moving the slider updates the numeric text readout and typing a new value into the readout will move the control to that value (provided it’s within the range that’s set for the slider).
So there’s a two way communication between these two components.
Your computer typically updates its graphics 60 times per second yet the control’s output is at audio-rate signal (typically 44,100 samples per second). So there’s a rate-conversion happening inside this module to make sure that a control value change doesn’t get missed due to the difference in sampling rates and methods.
The current position of the slider is stored in it’s internal patch-memory, and the slider will move automatically to reflect the current patch.
With this standard SynthEdit Slider the layout of the elements is fixed. There’s no way, say, to put the numeric readout at the top, as its a compiled SEM, not a prefab like the knob.
Important Notes:
DSP to GUI conversion; When creating sub-controls we must always convert the GUI float values to DSP voltages. DSP modules cannot be connected directly to GUI controls, and if the correct DSP to GUI conversion is not used the controls will behave unpredictably, and control signals will not update properly. You should always use a Patch Memory or Bridge module to communicate between the two.
Float to volts: Although you can connect Floating Point plugs directly to Voltage plugs, it’s strongly advised to use a Float to Volts converter so that the control value will pass correctly from the Float to the Voltage plugs. If you don’t values can be missed, passed incorrectly, or the module operation could be “glitchy”.
Why have sub-controls
The reason for having sub-controls is to separate the control into its constituent parts. This gives you more flexibility to customize the control. Here’s an equivalent sub-control based knob. It’s built inside a Container module.
Go to the module browser, or Menu Insert->Controls->Knob to load the prefab.
The Control Knob prefab.
Here’s the internal structure.
How it works: Three categories of Sub-Control:
1) Patch Memory:
The main hub of all the data exchange is the Patch Memory module. It handles the two way communication between the graphical or GUI elements (with light blue backgrounds) and the audio-processing or DSP elements (with grey backgrounds). Note some module such as patch memory have both light blue and grey backgrounds such as the Patch Memory modules – these act as a “bridge” between GUI and DSP.
The Patch Memory module also handles any MIDI Automation of the control and handles switching between presets (patches).
2) (Bitmap) Images and Text Entry4:
The second type of module here are graphical controls. These are the Bitmap Image and Text Entry4 boxes. These accept the user input value and display the control’s current value.
These graphical elements use the Patch-Memory module as sort of data ‘hub’. The values input from any module connected is transferred to all the other connected modules, keeping them in sync. The only connection which is a “one way street” is the DSP output. You can see from the arrow heads that the GUI plugs (light blue background) are bi-directional as we would expect. Updating the numeric-entry box moves the knob and vice-versa. These signals are not constantly sampled like audio signals but are event-driven. So the knob consumes CPU only when being moved. Compared to a DSP audio signal, the data flow to and from the knob is not constant and is at a much slower rate.
Useful Info: DSP data is always one way traffic. GUI data is almost always a two-way data flow to and from each control, although you can make GUI controls “read only”.
Important Note: Although you could use the filename plug on the Image2 control to switch between images dynamically (say for a colour or style change) you should not do this, as it will force a GUI restart/refresh and clear ALL Patch Memory values. This is to prevent the control panel view “glitching” .
3) Float to Volts conversion.
The third type of module here is datatype conversion. In this case the Float to Volts module. It’s purpose is to bridge the Patch Memory module’s numeric Floating Point value with the DSP Voltage that is sent via the IO Module. You could connect directly to the Floating Point Value Out plug, but its not advisable.
The signal leaves the Patch-Mem module as a DSP connection, but still at the slower rate generated by the GUI graphics system. The Float-to-Volt smooths out and up-samples to the correct signal rate suitable for driving SynthEdit’s various audio modules, and gives you control over how smooth the conversion should be. Less smoothing uses less CPU, but may sound ‘stepped‘ or ‘zippered‘.
It is good practice to to use the Float To Volts conversion module to make sure the control works smoothly and no data changes are missed by being out of sync with the DSP modules you will connect it to.
In SynthEdit audio rate signals are called Voltages because SynthEdit is simulating an old-school Voltage controlled Synthesizer.
The general structure of a Sub-Control patch is:
[Graphical Control]<—>[data type Converter]<—>[Patch Memory]—>[Audio Modules]
[GUI Modules]<———>[GUI to DSP Converter]<–>[Patch Memory]—>[DSP Modules]
Customizing the control.
The numeric input is optional, so it can just be deleted it if you don’t need it. Same with the rotating knob image, if you don’t like it, then it can be replaced with another similar image.
Also when the Knob prefab container is unlocked, and open, you can place the elements however you like, enabling you to rename the Knob, and move the title above, below or to one side of the control.
To rename the knob select the title’s Text Entry4 box, then in the properties panel change the “Text Entry4 setting from “Knob” to “Voltage” (or however you want to name it).
Adding a Voltage readout.
This is quite a simple modification. If we want to add a voltage readout to the knob control.
As you can see below it’s still based on the original prefab structure, but with the addition of two new GUI modules:
2) The Float To Text module is used to convert the scaled up Floating Point value to a text string. By changing the integer value on the Decimal Places plug we can set how many figures will appear after the decimal in the readout.
3) The Text Entry4 module displays the output voltage, and if you click in the text box and alter the value, the knob will move to reflect this new value. If you don’t want this behaviour then just untick the “Writeable” check box in properties.
4) Changing the control name: If you select the Text Entry4 control that displays the text “Knob” in the box, you can edit the text that it displays in the “Text” box in the properties panel to the legend of your choice
Note: Editing the “Name” text box in properties only changes the displayed name of the module in the structure view, not the title on the panel view.
Leave a Reply