| Contents |
|
Next |
In contrast to audio connections, where there is a clear direction of signal flow, GUI connections are bidirectional. Changes in values move both to the left and to the right. Again, we'll use one of the new SynthEdit prefab controls as an example. Here's the structure of the List Entry2:
Looking at just the top part, there's nothing new here. It's just a Dropdown List (titled List Entry2) with a Patch Mem - List2 converting the selection to an old fashioned List Entry output, like in our very first example in Making Simple Connections. A Text Entry2 has been added for labeling purposes, but we've seen this before as well. Now, looking at the new stuff, we see Bitmap Images with right and left arrows. Their Animation Position pins are connected, through Float to Bool converters, to the Increment and Decrement pins of an Increment2 sub-control, and that is connected to the Patch Mem - List2 just like the Dropdown list is.
Lets look at what's going on, step by step. A Bitmap Image's Animation Position is a Float value between 0 and 1.0. The arrow images have 2 frames, and are defined in their .txt files as
That means that the Bitmap Images in this case will simply output 1.0 when the image is clicked, and 0 when it is not. The rule used for converting Float values to Bool values is that Float values of zero or less equate to FALSE, and any positive value equates to TRUE, so the output of the Float to Bool converters will be TRUE when the arrow is clicked, and FALSE when it is not. The Increment2 module selects the next item in its list each time the Increment pin becomes TRUE, and selects the previous list item each time the Decrement pin becomes TRUE. So, you can go forward through the list by clicking the right arrow or backward in the list by clicking the left arrow, or you can select a list item directly using the Dropdown List. Notice that when you use the arrows to change the list selection, the selection on the Dropdown List also changes. The green wire between the Dropdown List and the Patch Mem - List2 transmits changes in either direction, and the List pin on the Dropdown List serves as both an input and an output. The arrowheads at both ends of a GUI connection are a reminder that these connections are 2-way. I didn't point it out at the time, but if you go back and look at the SynthEdit Knob prefab control example you'll see that the Animation Position pin of the reflective knob center also works as an input, so that the center also rotates when you turn the outer Moog knob image. Also, in the Bender prefab control example, note that the wheel's Animation Position pin works as an output when the wheel is being moved, but as an input when the Spring returns the Animation Position to the Reset Value on mouse up. The bidirectional nature of GUI connections makes it possible to design highly interactive controls. |
Next |