Contents


Using the Output Pins to Control Access

Next
  The system's output pins provide 3 items of information:
  1. Has the VST been registered?
     
  2. Is the demo period still in effect? (can only be true if the VST is not registered)
     
  3. Have either the DHRC2 or DHRC2A modules been replaced by a hacked version that simply forces items 1 or 2 to be True. (This is the output from the DHRC2.1.2 Validator).

Each of these has a True/False answer. These conditions can be used to control switches, visibility of controls or panels, and list selections.

DHRC2 and DHRC2A each provide outputs for "Registered?" and "In Demo Period?". This ensures that a valid check can be made despite the many varied ways that different VST hosts handle the opening and closing of the DSP and GUI sides of a VST, and the communication between the 2 sides.

So, we end up with 5 outputs for our 3 items of information:

  1. DHRC2       Registered?
  2. DHRC2       In Demo Period?
  3. DHRC2A     Registered?
  4. DHRC2A     In Demo Period?
  5. DHRC2.1.2 Validator Output

These 5 outputs need to be combined to control access to the VST or to specific features. For this, we use the logical operations of AND, OR, and NOT. The 3 logical operations work like this:

  • AND is True if all of its inputs are True
  • OR is True if any of its inputs are True
  • NOT is True if its input is False

The component modules of the DH_RegControl system work across both the GUI and DSP sides of the VST,  so some of the logical outputs are GUI pins of type Bool (black on blue background), which can be either True or False, and some are voltage pins (dark blue on gray background), for which a positive voltage means True, and 0 means False.

Bool values can be logically combined using DH_BooleanAnd, DH_BooleanOr, and DH_BooleanNot. Voltages can be logically combined using SE's AND Gate, OR Gate, and NOT Gate, which are found in the Insert menu under Logic. Bool values can be converted to voltages using DH_BoolToVoltage. AND, OR and NOT work the same way in any case.

Exactly what logical combinations you should use depends on what you are trying to accomplish. In the example above, the goal was very simple. There is just one final decision, at the output of the AND Gate. All of the "Registered?" and "In Demo Period?" outputs are connected with one OR Gate. If the VST is registered or in a valid demo period, and the modules have validated themselves, the Gate will be positive. Otherwise, it will be 0.

Any number of things could be done with the results of the AND Gate. It could turn the main switch or volume on or off. You might have a 0 result trigger a periodic beep or other noise.

There are a few guidelines that should be followed when using the system's outputs:

  • The 2 "Registered?" outputs (DHRC2 and DHRC2A) should be connected by an OR, because each serves as a backup for the other.
     
  • The 2 "In Demo Period?" outputs should also be connected by an OR if they are used, for the same reason.
     
  • Any critical results based on "Registered?" and/or "In Demo Status?" should be connected to an AND Gate together with the Validator output, as shown above, to maintain the integrity of the system.

By using additional ANDs, ORs and NOTs, you can build a control structure to provide different things for registered status than for demo status. The demo .se1 provides an example that's not too complicated. Here, in addition to having the synth play only if it's registered or in its demo period, the system outputs are also used to control the visibility of the button that invokes the registration dialog, so that it no longer appears after the synth is registered.

A Bool Splitter splits off the DHRC2's "Registered?" output in 3 directions. The middle one goes to a DH_BoolToVoltage for use in controlling whether the synth plays or not. The upper one goes to a DH_BooleanNot. From there, the output, which is now True if "Registered?" is False (because of the NOT) goes to the "Controls on Parent" of the BoolButton container, which contains the "Please Register" button and its caption. Therefore, the button and caption are visible only as long as the synth isn't registered. When "Registered?" becomes True, the output of the DH_BooleanNot, and thus the BoolButton container's "Controls on Parent"  becomes False, hiding the controls inside the container.

The bottom branch of the Bool Splitter form the "Registered?" output goes to a little prefab that displays "Unregistered !" if "Registered?" is False, or the user's name if "Registered?" is True. The structure of the Registered Display prefab is shown below. If "Registered?" is False, the output of the DH_BooleanNot  is True, and a DH_TextDisplay with the unregistered message, which is inside the top container, gets displayed. If "Registered?" is True, the Controls on Parent of the bottom container is true. There are two DH_TextDisplays inside, one with the words "Registered to" preloaded, and one that is used to display the User ID that is output by the DHRC2 if it determines that the VST/VSTi is validly registered.

Top

Next