The simple answer is that all the standard SynthEdit oscillators use what is called “Hard Sync”, which is an “all or nothing method. Using this method of “soft sync” allows control over how much sync is applied to the VCO. What we do is take a portion of the Master (Sync) Oscillators wave form as it crosses zero, and use this to Phase Modulate the Slave (Audio) Oscillator.
Third party modules:
There are two third party modules used for prefab the ED Zero Crossing Detector, and the ED Flip Flop (Audio). The Oscillator HD is one of the community SE modules available from the SE website.
The Soft Sync Master/Slave oscillator.
This consists of our two oscillators (master and slave) the output of the master is fed to the ED Zero Crossing Detector, which generates a very short (1 sample long) pulse everytime the output of oscillator 1 crosses 0 volts. We can set the detector to trigger on either the rising voltage, the falling voltage or both rising and falling. This is fed to the ED Flip Flop (Audio) which is used as a bistable so the first pulse triggers a “High” output, then the second resets the output to a “Low” output. This allows us to gate a one cycle long burst of the Master oscillator signal of variable ampliture to feed to the Slave Oscillators Phase Modulation plug. What we are effectively doing is using the output of the Master Oscillator to gently (or not so gently) change the phase of the Slave oscillator, thereby changing its output shape to a greater or lesser degree. Note: If you are intending to use large levels of Sync, or waveforms (such as ramp) with fast rise/fall times you will introduce aliasing, so it’s good policy to include oversampling in the Master/Slave Sync Oscillator’s container to limit this. The 1 Pole HPF is included to cut out any “LF rumbles”, or possibly DC from any aliasing produced by very fast phase changes.
Settings and values.
Settings for the ED Flip Flop are: V Threshold: 0.01 V. This is the input level at which the flip flop triggers and switches state. V Out: 10V. Both slave and Master Oscillator HD: Reset Mode: DCO (Sync). 1 Pole HP: Freq Scale: (Properties) 1kHz per Volt. Pitch: 0.014 (14Hz) Sync Gain: Level Adj Input 2: You can use the default of 0 to + 10V, but you can also go from -10 V to + 10 V which allows the sync to use phase reversal in the modulation.
Master 1 octave above Slave.
As you can see below changing the edge detection also affects the resulting output signal from the slave oscillator.
Rising edge zero crossing detection.
Falling edge zero crossing detection.
Using both rising and falling edge zero detection.
The stock ADSR module can be used as an Attack/Decay module, but it can under some conditions produce loud “pops and clicks” especially when used with a fast attack time (the so called exploding envelope bug). So far I have found no problems with this prefab with very short envelope attack times.
Third party modules required.
There are two third party modules required for this prefab, namely Elena’s ED Memory/Reset module, and Davidson’s DAM ASR module.
The Attack/Decay generator.
I used the DAM ASR module, but the module itself has a sustain built in after the attack segment is complete, and I wanted to go into the Decay (Release) segment immediately the peak of the Attack segment was reached. To do this I used a comparator to detect when the ASR module reaches 6.9 V (this appears to be the maximum), this is then fed back to the ED Memory/Reset module which resets the Gate signal to 0V. I know this is feedback loop with it’s inherent latency, but the few samples worth of delay really doesn’t cause any noticeable issues with the operation. The Curve plugs control the shape of the Attack and Decay segments individually, from a log curve, through linear to an exponential curve. Attack and Decay timings use the same formula for the stock ADSR module’s Volts to Seconds timing conversion. The first Level Adjust module is used to bring the AD envelope to the ususal 0 to 10 V range with the standard 0-10V slider control range. Note: As with the standard ADSR using a slider range of -10V to +10V gives both normal and inverted envelopes.
Unless you are a Linux/Ubuntu user you may not be familliar with the Zita Reverb. It’s a reverb effect that combines elements of Schroeder and FDN reverberators in a complex matrix of delays, all-pass comb filters and damping filters.
The Zita reverb has two separate delay times for low, and mid/high frequencies. There is a crossover frequency control to set the frequency where low becomes mid frequency range. The mix between the two reverb bands can be varied, as can the EQ for the frequency bands. The mixer also has a pre-delay time adjustment. Pre-delay is the amount of time before the onset of the reverberation effect. Longer pre-delay settings will add more depth to the reverb when the dry signal is up front in the mix.
Plugs. Left Hand Side:
L in:- Left hand side audio input. R in:- Right hand side audio input. Predelay (ms):- Sets the Pre-Delay time in milliseconds. Pre-delay is the amount of time before the onset of the reverberation. Crossover L-M (Hz):- Sets the Low to Mid crossover frequency. Low Time (s):- Sets the low frequency reverb decay time. Time (in seconds) to decay by 60db in the low-frequency band. Mid Time (s):- Sets the mid frequency reverb decay time. Time (in seconds) to decay by 60db in the mid-frequency band. HF Damp (Hz):- Sets the HF Damping frequency. EQ Low Freq (Hz):- Sets the low frequency reverb boost/cut EQ frequency EQ Low (dB):- Sets the low frequency reverb boost/cut EQ amount EQ Mid Freq (Hz):- Sets the mid frequency reverb boost/cut EQ frequency EQ Mid dB:- Sets the mid frequency reverb boost/cut EQ amount Mix:- Sets the mix between direct signal and reverb. Level dB:- Sets the output level in dB.
Right Hand Side:
L Out:- Left hand side audio output. R Out:- Right hand side audio output.
Structure of a typical Reverb effect prefab using the Zita Reverb module.
Structure of the Float output knobs.
Nothing very special-just that the Float to Volts converter is removed, and the DSP Value out is taken directly to the IO Module plug.
Setting up the control ranges.
There are no conversions needed for the controls and the value readout as the Float values are either Float Value=dB, or Float Value=Hz. Keeps things nice and simple. Pre-delay: A good range is 0 to 200 (mS). Crossover: 10 to 2000 (Hz). Low Time: 0.5 to 10 Sec (Don’t leave the “Low” as 0, the reverb will crash until the audio/plug-in resets). Mid Time: 0.5 to 10 Sec (Don’t leave the “Low” as 0, the reverb will crash until the audio/plug-in resets). HF Damp: 10 Hz to 10 kHz. I have seen the upper frequency suggested as 20 kHz, but that seems unnecessarily high to me. EQ Low Hz: 10 Hz to 1000 Hz. EQ Low dB: -20 dB to +20 dB. EQ Mid Hz: 1kHz to 10 kHz. EQ Mid dB: -20 dB to +20 dB. Mix: 0 to 100. Level (dB): A good range would be -40 dB to +10 dB.
Typical Settings.
Predelay: amount by which the “wet” signal is delayed relative to start of the “dry” signal. The range is usually between 0 to 200 ms, a good default is 60 ms. Crossover Freq: The crossover frequency separating the low and middle frequencies, The range is 10 Hz to 1000 Hz, a good default setting is 200 Hz. Low Release: The time for the reverb to decay by 60 dB in the low-frequency band. The range is 0.1 to10 seconds, a good default setting is 3 seconds. Mid Release: The time for the reverb to decay by 60 dB in the mid-frequency band. The range is 0.1 to10 seconds, a good default setting is 2 seconds. Damping Freq: The frequency at which high- and mid-band decay release times are equal, The range is 10 Hz – 10 kHz, a good default frequency is 6 kHz. EQ Low Freq (Hz): The center frequency of the Low EQ, Frequency range is 10-1000 Hz, a good default is 315 Hz. EQ Low (dB): The peak level of EQ section 1, The range is from -20 to +20 dB, default setting 0 dB. EQ Mid Freq (Hz): The center frequency of the Mid EQ, Frequency range is from 1 kHz to 10000 Hz, a good default setting is 1500 Hz. EQ Mid (dB): The peak level of Mid rangeEQ, Range between -20 to +20 dB, default 0 dB. Dry/Wet Mix: percentage, 0 (all dry) to 100% (all wet), a good starting point for an instrument is 50% (see below).
Tips for using Zita Reverb.
Use the Low Time and Mid Time settings. Adjust Low Release to control the tail length for low frequencies, and Mid Release for high frequencies. The ability to adjust these separately is the main distinctive characteristic of the Zita reverb vs. other reverbs. Damping. Increase Damping Freq for a bright sound, reduce for a dark sound (this also reduces tail length). Hint: excessively bright reverb sounds un-natural as high frequencies decay more rapidly than low frequencies. EQ Settings. Note: Be careful with the Low EQ settings as these can make your final sound a bit “boomy” at the bottom end- I have seen this as a criticism of Zita reverb being “boomy”, it’s not if it’s used with careful attention to the LF controls. Experiment with the EQ controls to balance tail length and tonal balance that suits your music. Don’t be afraid to experiment. Pre-Delay. If the idea of pre-delay seems confusing at first-you’re not alone, it took me a while to grasp it too! The Predelay setting allows you to delay the start of the wet signal (reverberated) relative to the start of the “dry” signal, to allow the dry signal to stand out in the mix with a clean “punch”. This keeps the mix from sounding “muddy”. Try using longer Pre-Delay time settings for creative effects. Reverb Mix levels. When using as an in-line effect on an instrument, you would normally keep the Wet Level below 0.5. Low values can be subtle but quite effective. When using as a Send effect set the mix at 100% so you get the full range of control over the mix on the return level stage.
Switching when a Variable voltage matches a Fixed voltage within a set range.
Have you ever needed to trigger an event when a Control Voltage is within a narrow range of values? There is a stock comparator, but on its own this will only give you a true or false if the voltage is above or below a set value. This prefab will tell you within a very narrow range when the Variable input is equal to your Reference input and output a “True” value. (I have tested this to a +/- 1mV range either side of the Reference). This prefab uses no 3rd party modules.
How the Voltage Detector works.
Comparator A sends a True value when the Variable is within the range -0 to -0.001 V of the Reference voltage. Comparator B sends a true value when the Variable is within the range +0 to +0.001V of the Reference voltage. These two voltages can be set to give the detecter a wider or narrower range. With these values Comparator A and Comparator B will both output a “True” value when the Variable is within + or – 1mV of the Reference. The AND Gate will only output a value of “True” when both inputs are “True”. The Buffer Amps are just Level Adj modules with a 1:1 gain to prevent the two comparator References interacting.
This module allows you to send commands to modules such as the Patch Info module. Sometimes you don’t want to use a popup menu to select the Pact Command options, it would be far more convenient to use momentary push buttons. This module allows you to do just that. The PatchInfo Module has five commands: Patch Copy, Open (Preset), Save As (Preset), Open (Bank), Save As (Bank).
Why not just use buttons? There’s a very good reason for this. When using commands that open new windows or dialog boxes it’s very important to trigger such commands as the user releases the mouse button, otherwise SynthEdit ‘loses’ the mouse and the button remains stuck down.
How the Prefab works.
We have five buttons (Image2) connected via Animation Position, to five Triggerators. Important Note: these buttons must be set as clicks or auto in the Mouse Response options, no other settings will work. The Reset outputs are all sent to the first Bool Plug on the Int to Bools module. These are used to reset the button to it’s off state after the selected operation has either been completed or cancelled. Each Trigger input to the Int to Bools module send the appropriate Integer number for the selected command to open its Dialogue Box. Once the operation has been completed the Int to Bools receives the 0 or reset signal from the Patch info module and resets the buttons to their Off state.
Option 1 (Patch Copy) button clicked. The button stays latched even though it is set up as momentary (clicks). When the Copy or Cancel Button on the dialogue box is clicked, and then released thebutton will revert to it’s off state.
This is a useful GUI module. It saves using conversion from GUI to DSP and back to GUI if you need to use math functions on a GUI float value. It works like the DSP Float Function module, with one notable difference, like most GUI modules it works in both directions. So as well as the A conversion formula, you need to specify the B conversion formula which is the inverse of the A formula; so if the B formula was A*100, then the A formula must be B/100. Note: The A formula is applied to the value received by Plug B and is output from plug A The B formula is applied to the value received by Plug A and is output from plug B. Note: If you only need the conversion to work in one direction, then there is no need to bother with the inverse formula. Note: If either the A or B function is left as an empty string or the value 0, signal flow from that pin will be disabled.
All the frequently used math functions are supported; multiply, divide, add, subtract, power, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log, log10, sqrt, floor, ceil, abs, hypot, deg, rad, sgn, min, max.
Example Float function usage.
Suppose you want to have a knob control’s readout display the slider value from 0 to 100, but you want to keep the actual control value in the default 0 to 10 range. This allows you to alter the displayed value, and by using the inverse function we are also allowing the user to enter a value (between 0 and 100) in the text box to change the control knob’s position and output, but still keep the control value inside it’s default range. The formula and it’s inverse can either be entered into the modules properties panel, or supplied as a text string to the appropriate plugs.
How the VU Meter uses Float Function.
Another use for the GUI Float Function is demonstrated in the VU Meter. We take the Audio input, and feed it into the Volts to Float module where the signal level is converted to floating point at a rate optimised for DSP, which will also give a suitable response time for the meter to be useful (Conversion rate = 60Hz), and the type of response is set to dB VU to suit a VU meter readout. The next step is to use a PatchMemory Float Out3 to convert the data from Audio/DSP to GUI, and to take the value output (not the Animation Position output) and feed it via the Float Function with these values for the Formulae: Formula A= B-18 Formula B= A+18 From here the data is sent via the dB to Animation module to convert the data to fit the scale used for the VU meter, this is where we finally use Animation Position to move the “meter” to the position that matches the Audio input on the VU “scale”. The actual meter we see on the panel uses two Image2 modules. The top one which displays the meter needle is connected to the Animation Position data, and the lower Image has no connections as it’s just the meter scale.
Attack, Decay, and Release time display using Float Function.
We can also use the Float Function to display the Attack, Decay, or Release time of the ADSR modules. The layout below does the job quite neatly. (You could use all stock modules but then you won’t have the text append function, or control over how the Value and Label Text Entry look on the Panel). Applying the math formulae for the conversion. The formula to convert the Volts (or in our case, GUI float, as it’s not yet DSP Volts) to ADSR timing is 10^(A*0.4-3) Because we want to convert the Float Value to ADSR timings the converted value needs to appear on the B Plug, so this is formula B. To convert a text entry to the Float Value for the ADSR timing we need to the inverse of this formula as Formula A which is (3+log10(B))/0.4 Both the Formulae. Formula A is (3+log10(B))/0.4 Formula B is 10^(A*0.4-3) If you study these two formulae carefully you can see just what is meant by an Inverse Formula, we are just working out how to perform the exact reverse of the original math function. (Add becomes subtract, multiply becomes divide and so on. It may seem at first look a bit random, but there is a logical structure in finding the inverse of a math formula…) Having both the A and B formulas allows you to control these times from either the knob or the text entry box.
The aim with this project was to create a rotary switch that behaves like a physical rotary switch-having “click stop” positions. This one doesn’t behave like the stock rotary switch if the number of list entries exceeds 10, but continues rotating until the last entry is reached. The waveforms are not shown as a list around the control, but in a text box underneath the control.
Third party modules.
This project requires SynthEdit 1.5 for the Vector knobs, and the following 3rd party modules to operate. Elena Novaretti’s ED modules; RD GUI Multiply (Float), ED GUI Add (Float), ED GUI Multiply. Note:- The ED GUI Fixed Float modules aren’t essential as you can put the values into the modules directly and they are retained. I have used them to make it easier to see what’s going on. Davidson’s DAM modules; DAM List size.
How the rotary switch works.
The basic idea is that Vector Knob B is used to control the Item selection, and via a chain of Math and datatype conversion modules to produce the “Stepped” motion in Vector Knob C. As usual the PatchMemory List3 takes the list of options from the module connected to the Value Out plug, which is then turned into an enumerated list. This is fed to and from the Vector Knob B to select the list option required. DAM List Size is used to output the total number of entries in the list which is used to control the stepping motion of Vector Knob C. The Animation position is fed to the ED GUI Multiply module where it is multiplied by 10, Note: I found that the GUI Add module was needed to add 0.5 to the 0 to 10 float range for the prefab to step through the options correctly, (this seems to be a bug of some sort with the enumeration as without it the last two steps select the same option). The scaled up Animation position is then passed through a GUI Float to Integer, then through a GUI Integer to Float to produce steps of 1 (Brute force Quantizing as there is no GUI Quantizer module). This is then Divided by 10 to produce the correct range of 0 to 1 float for the Animation, but in fixed steps of 0.1 float. Important notes regarding Vector Knobs B and C. There are some specific settings you need to apply to this for the prefab to look, and work correctly; Vector Knob B Background colour ARGB– 55000000, Foreground colour ARGB- 00FFFFFF Arrangement of controls- In panel view the Vector Knob B must be a) Behind Vector Knob C (Right click- Arrange- Move to back), and must be larger than Vector Knob C. I wanted it to look as if Vector Knob C had a transparent “skirt” around it to make it look like one complete control. Vector Knob C- Should be set as “Read Only”, if it’s not the prefab will still work, but you’ll lose the visual “click-stop” effect and just have continuous smooth rotary movement of the switch.
There are two ways to acheive this. 1) Image swapping, using the Choice Integer to select the appropriate image. 2) Using Frames in an image, Animation Position selects the correct image frame.
Image file switching.
The first way is to create a series of screenshots from the ‘scope making sure to get the size and framing accurate to prevent “jumping” or “jitter” when swapping the images. The images are then switched as each oscillator waveform is selected. This method requires some third party modules by Eleana Novaretti; ED GUI Fixed String, ED Switch > String.
How the image switching works.
The list of options is taken from the Oscillator module, and converted to an enumerated list composed of ; Choice, a list of Integers from 0 to 6 (the list of options always starts at 0) and Item List, the list of options in text form (each item separated by a comma). List to animation converts the List to Animation position, which is used to select Items from the list. The Integer part of the list is sent to the ED Switch > String, this takes the value from the approproiate ED GUI Fixed String and sends it to the Plain Image module, so as we rotate the knob and select the desired Oscillator waveform, the matching image is displayed.
To create your Images you’ll need some sort of picture editing software to crop them to a uniform shape and size using the ctrl+Print Screen combination, then pasting the screenshot into the photo editor to crop the images and save them.
Swapping images using Frames.
This works by having a single large image in a long vertical strip composed of all the required images, which is interpreted by SynthEdit as “Frames”. A text file is created along with this image file and stored with the file in the default skins folder. So if you name your image file waveforms.png, then you would need to name the textfile as waveforms.txt. An example of waveforms.txt could be; type animated frame_size 120 , 100 mouse_response rotary The line frame_size 120 , 100 is the telling Synthedit the dimensions in pixels each frame of the image file, so here each frame needs to be 120 px wide, and 100 px high. Width is specified first, then height. This needs to be correct to keep the animation of the frames smooth.
The list is taken from the VCO module and converted by the PatchMemory list into an enumerated list, then fed to the List to Animation module which sends the Choice value (as usual starting at 0) to the Vector Knob C (You could use a knob mage with an Image2 module-it’s your choice), and the Image 2 module. The Image2 module interprets the Animation position as a Frame number, and selects the correct section of the large image to display (this is why your image measurements must be correct, and consistent). Note: because the Animation Position data is bi-directional, if the Mouse Response for the Image2 module that displays the images is set to Horizontal or Vertical the mouse can also be used to select the waveform by clicking on the waveform display and dragging in the appropriate direction.
Which method is best?
Frames: Using frames gives the simplest structure to work with, but relies on making up a large composite image using identically sized smaller images. With this method the waveform display can also be used to select the Oscillator waveform. Individual images: Using individual images uses a slightly more complex structure, with carefully sized images, but saves making a large composite image with carefully sized and placed images. With this method it’s not possible to use the mouse with the waveform display to select a new waveform.
This module is one of the essential foundation blocks of any Sub-Control we would wish to make. It can be used to take an image or a series of frames of an image and use them to make a control such as a slider, a knob, an LED/Lamp, a push button, an indicator, a meter or a switch. The only downside is that the images that can be used being .bmp or .png they are not rescalable. For images to be rescalable they need to be vector of SVG garphics, which are not usable with this module.
The Image 2 module plugs.
Animation Position:- Selects which frame to display, the value of this is normalized between zero and one. Allows for for animating the image, and for generating a control value from this movement. Filename:- Enter the filename of the image (.bmp or .png). Hint: – This text displays as popup yellow tooltip when the mouse hovers over the image. Note: The Hint pin only works for clickable images. So to make the popup hint work for a rotary control, you need to create a basic text file containing – “mouse_response click”, and save it in the default skin folder (you could call it mouse.txt-the name isn’t important though). Menu Items/Menu Selection – Provides a right-click popup context menu for the image. This is commonly used for adding a MIDI-Learn menu. Mouse Down:- Provides a bool “True” signal whenever the mouse is clicked on the image, for the duration of the “click”. Frame Count – Outputs the total number of frames in the image. Used by the Image-To-Frame module.
Properties panel.
Mouse response allows you to choose how the control interacts with the user: Off- Disabled, no interaction. Hint popup is not available in this mode. Auto- Responds to vertical, horizonal step and rotary modes of operation. The hint popup operates in this mode. Vertical- Only responds to vertical mouse movement. Hint popup is not automatic in this mode. Horizontal- Only responds to horizontal mouse movement. Hint popup is not automatic in this mode. Clicks- Responds to a mouse down event on the the control. The control goes to the 1 position. A button is non-latching in this mode. Rotary- Responds like a rotary control. Hint popup is not automatic in this mode. Step- A rotary control moves in steps of 0.1. A button latches in the on or off position when clicked (depending on it’s current state).
The stock SynthEdit image files.
The file names are shown in brackets after the module name. By deafult these images are located in (For Windows, Not being a MAC user I don’t know their default location) C:\Users\Public\Documents\SynthEdit Projects\skins\default2.
How the image file is animated.
The Bitmap Image sub-control lets you use multiple-frame .bmp or .png images as controls. You have used them and seen them in action but here is a basic overview of what you need to know (as far as a non-programmer).
This image is made up of 40 images known as “frames”, which means the animation runs very smoothly. In the skins default folder there is a text file referenced by the Moog control knob, this is the moog_knob.txt file, and this is what it contains: moog_knob.txt type animated (Tells Image2 that the control is meant to move) frame_size 48, 45 (The size of the image file in pixels) mouse_response rotary (The control rotates) padding 13, 7, 13, 4 (The amount of space (padding) to allow round the knob. As the image rotates the position of the knob image is converted to a float value. In the structure in figure below, a PatchMemory Float3 and a Float to Volts converter convert the image’s Animation Position to a voltage output. Any multi-frame image can be used in this way to create visual controls such as buttons, switches, knobs and sliders.
Using the “Moog” Knob.
The two Image2 modules are linked so that the shiny cap will rotate with the knob. Animation position is also fed to the PatchMemory Float3 module, and converted to a DSP signal> this is converted from Float to Volts, any steps or jerkiness is smoothed out, and output at the IO module. Hint: Make sure that both Image2 modules have their Mouse Response properties set the same, otherwise the two different rotations can look a little odd. Hint: Sometimes you will want this control to send information to another GUI external module or prefab. In this case always make a connection from either the Animation position or GUI Value plugs on the IO Module. Don’t waste resources by converting the DSP Voltage back to GUI Float again. Hint: When you connect up a Text Entry module for a label for the control it’s a good move to connect the Text input to an IO module (you won’t have to keep opening up the module to change the label, unlike the stock Moog knob prefab).
Creating a slider control.
This uses the vslider_med.png image, and the vslider_med.txt information file the contents of which are shown below; type slider frame_size 28, 40 handle_rect 4, 41, 28, 55 handle_range 1, 26 orientation vertical For this control you can leave the mouse response setting as Auto- we don’t want to change this.
Creating a Button type switch control.
Here the image of a button has just two “frames”, for it’s “on” and “off” states. Click on the ellipsis by the filename box in the properties and find the button.bmp file, and load it into the module. The text file associated is quite simple, and needs no alteration. type animated frame_size 18, 30 mouse_response click. To change the mouse response for our prefab, you can do this from the Image2 properties, go to the MouseResponse List. Auto or Clicks will give you a momentary switch, Step a latching switch. Vertical, Horizontal or Rotary will work, and give you a Latching button, but I would really discourage doing this as it’s going to confuse your VST’s users.
Or you can use button_sm.png
Creating your own On/Off Switch.
The same principles apply to creating your own on/off switch. Click on the ellipsis by the filename box in the properties and find the switch.png file, and load it into the module.
This is the switch.txt file associated with it (I’m just showing you this for reference)- SynthEdit automatically reads this file. ; medium vertical slider type animated orientation vert frame_size 25, 26 ; extra space at: top, bottom, left, right padding 5, 2, 5, 3 mouse_response stepped You can see it’s quite different (the lines with the semi-colons are just comments-not read or used by SE) from the moog_knob file. For a start the orientation is vertical, not a rotary control, and that extra line at the end mouse-response stepped means that when you click on the control it stays in it’s new state until you click on it again. In this application the Animation position does not change value gradually with control position, it has just an on and an off state, with a float value of 1=on, and 0=off. The observant among you will notice I have connected the LED prefab directly to the Animation Position…but the LED prefab has a DSP Plug. I took out the conversion modules and connected directly to the Image2 module in the LED prefab (saving on un-ncessary DSP-GUI conversions). So we now have a switch with a label and on/off LED indicator.
Hint: So you need a non-latching (momentary) switch? Thats easily done, click on the Image2, and in the properties panel click on the Mouse Response list, and change from Auto, to Clicks. Now your switch won’t stay in the same position, it will “flip” back to it’s default off position.
Hint: If you leave the Mouse Response as Auto then it will use the setting in the associated text file. If you select anything but Auto from the list, this will over-ride the setting in the text file.
Small Illuminated Push-Button.
A simple little prefab that gives a small circular illuminating push button switch. Look for the image file Led.png in the ususal way, and select either clicks for a momentary switch action, or step for a toggled (locking) button.
How to create a “roll your own” customizable Joystick control prefab.
Note: This relies heavily on third party modules: Davidson’s DAM modules; DAM V XYo Circle, DAM Rectangle. Elena’s ED GUI Modules; ED GUI Fixed In, ED GUI Fixed Float, ED GUI Timer.
Once again I’m going to stress that you should never convert from a GUI signal to DSP, perform a math or timing function, then convert this back to a GUI signal. It’s very wasteful on CPU resources, and can cause many problems.
GUI Container for the Joystick.
The Joystick control iteslf uses the DAM V XYo Circle module. This resturns the position of the circle, which can be extensively customized. Here I have pre-set it with a red theme. In the interests of simplicity I’m just connecting the following plugs to the IO Module; 1) Animation Position- The output value of this plug is 0 till the circle receives a click (Mouse Down), it then changes to 10. 2) Position X- The X co-ordinate (horizontal) of the circle (Normalized value of 0-1) 3) Position Y- The Y co-ordinate (vertical) of the circle (Normalized value of 0-1) 4) Circle Size- The size in px of the circle.
The settings in the properties panel are shown below. Make sure the Jump Back Position List is set as “None”, the Mouse Response is set to “Click”, and The Gradient Lock check boxes are ticked. These are the colour settings I used, but as always that’s your personal choice. Mouse response- This selects various modes, the main ones are; None- Nothing happens when you click on the circle, and it’s locked in position. Click- Click on the circle and the Animation Position changes to 10, the circle assumes its “Alt” colour scheme, and can be moved. Step- Click on the circle and the Animation Position changes to 10, the circle assumes its “Alt” colour scheme and the circle can be moved. The Animation Position value and “Alt” colours are held until a second mouse click is received.
Settings for the DAMV XYo Circle and DAM Rectangle modules.
I have shown these settings as screenshots.
The control section.
The x and y output values are passed as usual to PatchMemory Float3 modules. These then send the Float values to the output IO module as GUI Float, DSP Float and Volts. The Volts as usual is converted by the stock Float to Volts module. Returning the Joystick to the centre position. This is done with a pair of Spring 3 modules to send a value of 0.5 to the Position X and Position Y plugs. The ED GUI Timer is used to send a short (10 mS) pulse to the Spring 3 modules when the Centre On/Off plug is set to true. (I found that the Joystick wasn’t reliably setting to the centre when switched on otherwise). Setting the Joystick’s output ranges. As usual the ranges of the output values can be specified via the Patch Memories. To make this easier I recommend changing the Patch Memory names in the Properties panel to something like x-axis range, and y-axis range.
X and Y Value (GUI) containers.
These are just standard Float to Text conversion, both connected to the Value output of the PatchMemories to show the actual value being output by the joystick, rather than the Animation Position.