vvvv-patching
vvvv Patching Patterns
Dataflow Basics
- Left-to-right, top-to-bottom execution order
- Links carry data between pads (input/output connection points)
- Spreading — connecting a
Spread<T>to a single-value input auto-iterates the node - Every frame, the entire connected graph evaluates; disconnected subgraphs are skipped
Both visual patches and C# source projects operate in a live environment — edits take effect immediately while the program runs. Patch changes preserve node state; C# code changes trigger a node restart (Dispose → Constructor). You can adjust parameters, add connections, and restructure patches while seeing results in real-time.
When to Patch vs Write C#
| Patch | Code (C#) |
|---|---|
| Data flow routing, visual connections | Performance-critical algorithms |
| Prototyping and parameter tweaking | Complex state machines |
| UI composition and layout | .NET library interop |
| Simple transformations | Native resource management |
As a rule: patch the data flow, code the algorithms.
Regions
Regions are visual constructs that control execution flow:
| Region | Purpose | C# Equivalent |
|---|---|---|
| ForEach | Iterate over Spread elements | foreach loop |
| If | Conditional execution | if/else |
| Switch | Multi-branch selection | switch |
| Repeat | Loop N times | for loop |
| Accumulator | Running aggregation | Aggregate/Fold |
Process Nodes in Patches
Process nodes are the primary way to add state to patches:
- They have a Create region (runs once) and an Update region (runs each frame)
- Internal state persists between frames
- Can contain sub-patches for complex logic
Channels — Reactive Data Flow
Channels provide two-way data binding:
IChannel<T>— observable value container.Value— read or write the current value- Channels persist state across sessions
- Connect channels between nodes for reactive updates without explicit links
Event Handling
- Bang — a one-frame
truepulse (trigger) - Toggle — alternates between
trueandfalse - FrameDelay — delays a value by one frame (breaks circular dependencies)
- Use
Changednode to detect when a value changes between frames
Patch Organization
Naming Conventions
- Use PascalCase for patch names and node names
- Group related operations under a common category
- Use descriptive names that indicate the operation (verb + noun)
Structure
- Keep patches focused — one purpose per patch
- Extract reusable logic into sub-patches
- Use IOBox nodes for exposing parameters
- Add Pad nodes to create input/output pins on the patch boundary
Common Anti-Patterns
- Circular dependencies — use FrameDelay to break cycles
- Too many nodes in one patch — extract sub-patches
- Polling instead of reacting — use Channels for reactive updates
- Ignoring Nil — always handle null/empty Spread inputs gracefully
For common patterns reference, see patterns.md.
More from tebjan/vvvv-skills
vvvv-spreads
Helps write code using vvvv gamma's Spread<T> immutable collection type and SpreadBuilder<T>. Use when working with Spreads, SpreadBuilder, collections, arrays, iteration, mapping, filtering, zipping, accumulating, or converting between Span and Spread. Trigger whenever the user writes collection-processing C# code in vvvv — even if they say 'list', 'array', or 'IEnumerable' instead of Spread, this skill likely applies.
47vvvv-fundamentals
Explains vvvv gamma core concepts — data types, frame-based execution model, pins, pads, links, node browser, live compilation (source project vs binary reference workflows), .vl document structure, file types (.vl/.sdsl/.cs/.csproj), ecosystem overview, and AppHost runtime detection. Use when the user asks about vvvv basics, how vvvv works, the live reload model, when to patch vs code, or needs an overview of the visual programming environment.
47vvvv-channels
Helps work with vvvv gamma's Channel system from C# — IChannelHub, public channels, [CanBePublished] attributes, hierarchical data propagation, channel subscriptions, bang channels, and spread sub-channels. Use when reading or writing public channels from C# nodes, publishing .NET types as channels, working with IChannelHub, subscribing to channel changes, managing hierarchical channel state, or implementing reactive/observable data flow. Trigger for any mention of IChannel, IChannelHub, reactive binding, observable state, two-way data binding, or TryGetChannel in a vvvv context.
46vvvv-dotnet
Helps with .NET integration in vvvv gamma — NuGet packages, library references, .csproj project configuration, the [assembly: ImportAsIs] attribute, vector type interop, and async patterns. Use when adding NuGet packages, configuring build settings, referencing external .NET libraries, setting up the ImportAsIs assembly attribute, working with System.Numerics/Stride type conversions, or when nodes aren't appearing in the node browser due to missing assembly configuration.
46vvvv-node-libraries
Helps set up C# library projects that provide nodes to vvvv gamma — project directory structure, Initialization.cs with AssemblyInitializer, service registration via RegisterService, IResourceProvider factories, ImportAsIs / ImportNamespace / ImportType selection, category organization, .csproj setup, and dynamic node factories via RegisterNodeFactory. Use when creating a new vvvv library, VL package, NuGet package for vvvv, deciding which import attribute to use, organizing categories, controlling which public types become nodes, registering services or node factories, or setting up the project structure. Trigger when the user says 'create a package', 'make a library', 'distribute nodes', 'organize categories', 'hide internal helpers from the node browser', or 'publish a VL package'.
46vvvv-shaders
Helps write SDSL shaders for Stride and vvvv gamma — TextureFX, shader mixins, compute shaders, and ShaderFX composition. SDSL is a superset of HLSL, so use this skill when writing or debugging .sdsl shader files, GPU shaders, visual effects, HLSL code for vvvv, working with the Stride rendering pipeline, composing shader mixins, or any GPU/compute work. Trigger even if the user says 'HLSL', 'shader', 'GPU effect', 'render pass', or 'compute' in a vvvv context.
45