Vuo Visual Programming Environment

repository·main·Indexed 41 days ago

https://github.com/vuo/vuo

A visual programming environment including an Editor, Compiler, Renderer, and Runtime. The Vuo SDK provides Vuo.framework for compiling and controlling compositions, and VuoRunner.framework for launching precompiled compositions on macOS 64-bit. It includes command-line tools such as vuo-compile, vuo-debug, vuo-export, and vuo-link, as well as support for creating custom nodes, types, and input editors.

Tokens
29.5K
Snippets
40
Records
150
Agent score
48%

What's inside Vuo

  1. Overview of Leap Motion support in Vuo

    main
    Vuo includes support for Leap Motion hardware. This integration is made possible through a mutual agreement with Leap Motion, allowing the distribution of Leap.h, LeapMath.h, and libLeap.dylib within the Vuo ecosystem. This overrides the standard proprietary headers for the purpose of this distribution.
  2. Overview of developing node classes and types

    main

    In Vuo, a node class is a template for a node found in the Node Library. When you add a node to a composition, you are creating an instance of a node class. Developers can create new node classes, custom data types, and library modules to extend Vuo's functionality and share them with other users.

    Key areas for development include:

    • Node Classes: The logic and behavior of a node.
    • Data Types: Custom data structures that can be passed between nodes.
    • Library Modules: Shared code used by both node classes and types.
    • Node Sets: Bundled packages containing node classes and their supporting files.
  3. Use the vuo.image node set for 2D image processing

    main

    The vuo.image node set provides tools for creating, filtering, and retrieving information from 2D images.

    Nodes in this set are categorized as:

    • Image Filters: Take an input image and apply an effect to produce an output image. Search the Node Library for image filter to find these.
    • Image Generators: Create new images from scratch. Search the Node Library for image generator.
    • Image Transitions: Create new images by combining two input images. Search the Node Library for image transition.

    To use a 2D image in a 3D scene, use the Make 3D Object from Image node in the vuo.scene node set.

  4. Explore Vuo text-based programming resources

    main

    Vuo provides several resources for developers interested in text-based programming beyond the visual editor:

    • Vuo SDK: Includes the Vuo framework (nodes, compiler, and runner), command-line tools, and example projects for creating add-ons or embedding Vuo in other applications.
    • Source Code: The complete source for the SDK and the Vuo editor is available on GitHub.
    • API Documentation: Detailed technical documentation for the Vuo framework.

    Before diving into the API, it is recommended to read the Vuo Manual to understand the core concepts of how Vuo operates.

  5. Use RS232 Serial nodes for device communication

    main

    The vuo.serial node set allows Vuo compositions to communicate with physical devices via RS232 serial protocols (often via USB).

    Key Nodes

    • Receive Serial Data: Receives pieces of data (encoded as numbers/bytes) from a serial device.
    • Send Serial Data: Sends pieces of data to a serial device.
    • Convert Data to Text: Translates incoming serial data (UTF-8 or ASCII) into Vuo text types.
    • Convert Text to Data: Translates Vuo text into serial data for transmission.
    • Split Text Stream: Useful for reassembling text that arrives in small chunks (e.g., receiving "He", "llo ", "world" instead of the full string).

    Data Handling

    Serial communication operates on bytes. If your device communicates using text, you must use the conversion nodes mentioned above to bridge the gap between Vuo's data types and the serial byte stream.

  6. Work with tabular data in Vuo

    main

    Vuo uses a Table data type to represent information in a grid of rows and columns, similar to a spreadsheet.

    Importing Data

    You can import spreadsheet data into a Vuo composition using:

    • Fetch Data: To load files from a path.
    • Make Table from Text: To convert raw text strings into a table structure.
    • Common formats include CSV (Comma-Separated Values) and TSV (Tab-Separated Values).

    Exporting Data

    To export a Vuo table for use in spreadsheet applications (like Excel), use:

    Data Types and Conversions

  7. What is a library module in Vuo

    main
    A library module is a way to provide shared functionality that multiple node classes and types can use. It can contain functions and data structures, similar to a Vuo Type. However, unlike a Type, a library module's data structures are not used for storing port data. Library modules are often used to wrap non-Vuo libraries or frameworks.
  8. How to write an input editor

    main

    An input editor is a Qt plugin that implements the interface defined by the VuoInputEditorFactory class. To create one, you must implement two classes:

    1. A derived class of VuoInputEditorFactory.
    2. A derived class of VuoInputEditor.

    Implementation Options

    You can derive from VuoInputEditor directly, or use these convenience classes from the Vuo SDK (framework/resources/inputEditorWidgets):

    • VuoInputEditorWithMenu: For menu-based selection.
    • VuoInputEditorWithLineEdit: For text field input.
    • VuoInputEditorWithDialog: For complex dialogs containing multiple widgets.

    Metadata Requirement

    Every input editor requires a JSON-formatted metadata file that specifies the name of the type the editor is capable of editing. Refer to ExampleLanguageInputEditor.json in the SDK example project for the required schema.

  9. Understand Vuo Image Coordinates

    main

    Vuo uses a specific coordinate system for 2D images:

    • Origin (0,0): The center of the image.
    • X-axis: The image has a width of 2. The left edge is at -1 and the right edge is at 1.
    • Y-axis: The height is determined by the image's aspect ratio. The Y-coordinate increases from bottom to top.
  10. Naming conventions for custom data types

    main

    Reserved Names

    Do not begin your type's name with "Vuo". This prefix is reserved for types distributed by Team Vuo / Kosada. Use your own company or personal name to avoid confusion.

    To ensure compatibility and ease of use, follow these patterns:

    • Type Names: Use UpperCamelCase (e.g., MyCustomType). For abbreviations, capitalize only the first letter (e.g., MyMidiNote, not MyMIDINote).
    • Function Names: Prefix functions with the type name and an underscore (e.g., MyType_functionName()).
    • Constructors: Use the make suffix for constructor functions (e.g., MyType_make()).
  11. Choose between Vuo.framework and VuoRunner.framework

    main

    The Vuo SDK provides two primary frameworks for macOS 64-bit applications depending on your integration needs:

    • Vuo.framework: Use this to enable apps to compile, launch, and control Vuo compositions.
    • VuoRunner.framework: Use this to enable apps to launch and control precompiled compositions.

    Detailed guidance on choosing between these options can be found in the Vuo API documentation.

  12. How Vuo manages concurrency and threading

    main

    Vuo compositions are multithreaded for performance. The Vuo compiler acts as a parallelizing compiler, generating code that allows independent parts of a composition to run concurrently.

    While the compiler handles most synchronization automatically, it provides specific guarantees for node implementation:

    • Sequential Node Execution: For any single node instance, the compiler guarantees that its functions (such as nodeEvent() or nodeInstanceEvent()) are called sequentially. Two calls to the same node instance will never overlap.
    • Instance Isolation: While functions for a single instance are sequential, calls to different instances of the same node class may overlap. Therefore, a node class's functions do not need to be mutually thread-safe or re-entrant by default, as long as they only operate on instance-specific data.

    Users can control certain threading behaviors, such as offloading long-running tasks to the background, via the Vuo composition settings.