Visual Programming: Advanced Cantata Capabilities


A Hands-on Approach to Visual Programming

  1. Variables: the variables subform is used to define variables and evaluate expressions. Once variables have been defined they can be used in place of integer, float, and double arguments of glyphs. Valid expressions may include variables, standard arithmetic operators, and logicals, as well as predefined constants and functions. To define a variable, follow the format:
    variable = expression
    EX: Predefined Constants:
        log2e  (value = 1.4426950408889634074)
    EX: Predefined Functions: 
        gnoise (gnoise[x] Gaussian noise function)
    EX: Logical Operators: 
        == or .EQ. see if two expressions are equal
    EX: Instruction or Statement:
        i=(i>10)?0:i+1 
    EX: User Defined Functions:
        f(x,y)=cos(sqrt(x**2+y**2)*exp(0.0-sqrt(x**2+y**2)/4)
        enter f(0,0) to evaluate the function at x=0 and y=0
    EX: Arithmetic Operators:
        *, /, -, +, **
    EX: Arithmetic Bit-wise Operators:
        <<  shift first expression to the left by the second
    EX: Arithmetic Assignment Operators:
        ^= bit wise XOR
    


    Variables subform

  2. Procedures (subroutines): hierarchy within cantata is supported via procedures. Procedures are ONLY valid within the current workspace. In order to share procedures across different workspaces, you should first create the procedure and then create a Encapsulated Workspace from it.


    Click inside the image to see inside the Procedure

  3. Control Structures: these structures provide constructs to direct the flow (control and data) of a visual program. Two types of constructs: conditional and looping.
  4. Encapsulated Workspaces: the process of creating an independent application from a visual program is referred to as encapsulating a workspace. The functionality of a visual program is "stored" as a new Khoros program called an encapsulated workspace. This new encapsulated workspace can be brought into cantata as a new operator, accessible via Toolbox Menus, teh Accelerated Routines list, and the Accelerated Finder list, just like any other Khoros program. The new independent application can be run without display of the network of glyphs that define the visual program. Once the a visual program is ready for encapsulation, the command line user interface and the graphical user interface for the new program must be defined.

    NOTE: for Encapsulated Workspaces you need to be familiar with the Khoros software development tools (guise, composer, craftsman).

    An encapsulated workspace is a software object, i.e., it is a pane object. It is NOT composed of either C code or a scripting language interpretaion if the visual program. The key components of an encapsulated workspace are:

    Creation of Encapsulated Workspaces.

  5. Data Transport and Distributed Processing: (not available yet)

In summary, cantata is used by the visual programmer to interactively develop visual programs by combining glyphs into a visual program or network.


DIP Feedback Form

Copyright © 1995 KRI, ISTEC, Ramiro Jordán, Roberto Lotufo. All Rights Reserved.