Experimental: Embedded C# Editor in Gamma HDE

I’ve been playing around with the idea of having a native C# editor docked directly inside the vvvv Gamma HDE. I wanted to share this Proof of Concept demonstrating that it’s possible to host a WPF-based editor (RoslynPad) as a dockable window within the Gamma environment.

What is this?

It’s an HDE extension that bridges WinForms and WPF to bring a real code editor into the patcher. It uses a ProcessNode architecture to manage the window lifetime and a gate mechanism to sync text without overwriting user input every frame.

Why?

The main motivation here is exploring “code-in-place” workflows. Specifically, I wanted a fast way to paste and tweak AI-generated C# code directly into a patch without the friction of switching to an external IDE. It’s a step towards faster prototyping when working with LLMs and custom nodes.

Current State & Technical Note

  • WPF inside WinForms: Hosted via ElementHost.
  • Versioning Hack: There’s a known conflict between Gamma’s Roslyn (4.11) and the latest RoslynPad (4.12). For now, it falls back to basic C# syntax highlighting (via AvalonEdit) if the full RoslynHost fails to initialize.
  • Virtual Documents: It supports mapping in-memory strings to virtual file paths for language services.

Disclaimer

This is a Proof of Concept only. I am sharing this to demonstrate the possibility and hopefully inspire the dev team. I am not planning to maintain or support this. Use it as a reference or a starting point for your own HDE experiments!

Code Editor.zip (4.5 MB)

10 Likes