Spread the love

Creating a slider control, and making it your own is quite a simple process.
In the example below I have created a slider control that operates more or less like the stock slider.
The difference is that by the addition of the two ED Text Entry modules, and a Float to Text module we can make the readout and label for the slider more versatile.
Using the FG ARGB (Text) and BG ARGB (Background) we can change the text and background colours, and even make the background transparent.
The Decimal Places plug controls how many 0’s appear after the decimal point.
-1 gives us a default of 2 DP’s, 0 the obvious 0 DP’s and then with positive integers 2,3,4 DP’s etc.
Make sure that you set the Enabled Plugs on the Label Text Entry module to False, and the Alpha Disabled to 1 to prevent users clicking on the text and editing it.
whether you set the Value Text Entry module to Enabled or Disable depends on whether you prefer not to have the control value editable by clicking on it.

Below is the finished control prefab with both Float and Volts output.
The ARGB values, label, and decimal points can all be set without opening the prefab.

Now is where this control comes into its own. You want to re-arrange the layout so the title of the control is above or to one side? -simply edit the panel view. You want to convert the volts readout to another format? just add some more modules. You wanted red text on a grey text box? again no problem just change the ARGB values.

Adding 1V/Octave to Hz conversion for the value.

How many times have you wished that the slider could be made to display the frequency in Hz of a filter or oscillator that’s scaled in 1V/Octave?
This just requires a modification to the display of the slider value. We want to convert from Volts to Hz, then append Hz to the value.
Fortunately Elena Novaretti has once again made the job easier with some handy modules: ED Oct2Hz, ED GUI String Append, and the ED Fixed_String modules.
Just remember when you’re entering Hz into the Fixed String value to put a space before the Hz so there’s a space between the value and the Hz.
Notice that as well as the DSP Float and Volts output, I have now added a GUI Float output as well.

Want to display in kHz? No problem.

Simply add the ED GUI Divide (Float) module, set the value of Input 2 to 1000, and change the fixed text string to read kHz.

ADSR Time readout for the Slider.

Yes, there is a way of doing this in the old Wizzoo book by David Haupt, but this would involve converting from GUI Float to DSP Float, and then back to GUI float again which would be very wasteful of CPU resources.
Instead we can use a Float Function in the Float to Text conversion process by entering the formula of 10^(Volts*0.4-3) into the Float Function’s Formula: A = Plug properties, and just enter A into the Formula B: = Plug properties
(we aren’t using the B to A direction, only A to B), but something must be in the Formula: B= section for the module to work.
We can use this slider for the Attack, Decay and Release sliders.

ADSR Time readout
Modifying the slider to give a time readout for use with the ADSR2 module.