Skip to content

About

Bevy for VJs

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

865 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

rustjay-engine

High-performance, cross-platform VJ engine built in Rust โ€” for VJ applications what Bevy is for games.

๐Ÿ“– Guide

What is it?

rustjay-engine is a Cargo workspace of focused crates that handles all the infrastructure of a live visual performance tool:

  • GPU rendering via wgpu (Metal / Vulkan / DX12)
  • Video I/O โ€” Webcam, NDI, Syphon (macOS), Spout (Windows), V4L2 (Linux)
  • DeckLink capture input (Blackmagic)
  • Real-time audio analysis โ€” FFT, beat detection, 8-band spectrum
  • Audio-reactive parameter routing โ€” FFT bands โ†’ any parameter
  • LFO modulation (3 banks, 5 waveforms, tempo-sync to BPM)
  • Ableton Link โ€” join a shared tempo session with Live, Serato, Traktor, etc.
  • ProDJ Link โ€” BPM, beat phase, and track metadata from CDJ/XDJ/DJM gear
  • MIDI learn and mapping
  • OSC server
  • Web parameter server (REST + live push)
  • Presets with quick-slots (Shift+F1โ€“F8)
  • Multi-channel mixer โ€” N-channel compositing with FX chains and scene persistence
  • Projection mapping โ€” output post-processor with dome, warp, edge-blend, slicer
  • DMX lighting output โ€” sACN / Art-Net with per-fixture pixel sampling
  • ISF shaders โ€” load any Interactive Shader Format .fs at runtime
  • Dual-window architecture โ€” Control (ImGui / egui) + Output (fullscreen GPU)

You bring the shader and the idea. The engine handles everything else.

Workspace layout

rustjay-engine/
โ”œโ”€โ”€ crates/
โ”‚   โ”œโ”€โ”€ rustjay-core        # EngineState, command enums, LFO, routing types
โ”‚   โ”œโ”€โ”€ rustjay-audio       # AudioAnalyzer, FFT, beat detection
โ”‚   โ”œโ”€โ”€ rustjay-io          # InputManager, OutputManager (Webcam/NDI/Syphon/Spout/V4L2/DeckLink)
โ”‚   โ”œโ”€โ”€ rustjay-control     # MIDI, OSC, Web server
โ”‚   โ”œโ”€โ”€ rustjay-presets     # Preset save/load/quick-slots
โ”‚   โ”œโ”€โ”€ rustjay-sync        # Ableton Link + ProDJ Link + MTC tempo sync (optional)
โ”‚   โ”œโ”€โ”€ rustjay-gui         # ImGui + egui control window, all built-in tabs
โ”‚   โ”œโ”€โ”€ rustjay-render      # wgpu pipeline, blit, textures, uniforms
โ”‚   โ”œโ”€โ”€ rustjay-mixer       # Multi-channel compositing mixer with FX chains
โ”‚   โ”œโ”€โ”€ rustjay-projection  # Output post-processor (dome, warp, edge-blend, slicer)
โ”‚   โ”œโ”€โ”€ rustjay-lighting    # DMX lighting output โ€” sACN / Art-Net pixel sampling
โ”‚   โ”œโ”€โ”€ rustjay-ledmap      # CV-based addressable-LED mapping (flash pattern โ†’ per-LED positions)
โ”‚   โ”œโ”€โ”€ rustjay-isf         # ISF shader support โ€” GLSLโ†’WGSL transpiler + EffectPlugin adapter
โ”‚   โ”œโ”€โ”€ rustjay-api         # Optional REST/OpenAPI layer
โ”‚   โ”œโ”€โ”€ ledmap-studio       # Standalone CV LED-mapping tool โ€” calibrate strips, export ledmap.json
โ”‚   โ””โ”€โ”€ rustjay-engine      # Facade โ€” app runner, config, re-exports
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ template            # HSB colour + full I/O (reference app)
โ”‚   โ”œโ”€โ”€ delta               # RGB delay / motion extraction (ImGui)
โ”‚   โ”œโ”€โ”€ delta-egui          # Same as delta with egui backend
โ”‚   โ”œโ”€โ”€ flux                # Optical-flow warp with motion feedback trails
โ”‚   โ”œโ”€โ”€ waaaves             # Multi-pass feedback pipeline
โ”‚   โ”œโ”€โ”€ sputnik             # Indexed mesh + vertex-shader displacement (Rutt-Etra style)
โ”‚   โ”œโ”€โ”€ isf-example         # Runtime ISF shader loader with auto-generated UI
โ”‚   โ”œโ”€โ”€ mixer               # 2-channel mixer demonstrating rustjay-mixer
โ”‚   โ”œโ”€โ”€ projection          # Projection mapping demonstrating rustjay-projection
โ”‚   โ”œโ”€โ”€ videowall           # HDMI-matrix mapper โ€” N outputs, sourceโ†’cell grids, AprilTag calibration
โ”‚   โ”œโ”€โ”€ decklink            # Blackmagic DeckLink capture input
โ”‚   โ”œโ”€โ”€ vp404               # SP-404-style video sampler (port of rustjay-404)
โ”‚   โ””โ”€โ”€ webapp              # Web-based control panel (React + WebSocket / WASM + WebGPU)
โ””โ”€โ”€ guide/                  # mdBook user guide โ†’ https://BlueJayLouche.github.io/rustjay-engine/

Quick start

# Cargo.toml
[dependencies]
rustjay-engine = "0.2"
bytemuck = { version = "1.21", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
anyhow = "1.0"
env_logger = "0.11"
log = "0.4"

The engine repo carries two runtime fixes that crates.io builds don't get: wgpu-hal (EGL config selection on Raspberry Pi / Mesa vc4) and nokhwa-bindings-macos (USB and Continuity cameras that crash AVFoundation). If you target either, pull them in:

[patch.crates-io]
wgpu-hal              = { git = "https://github.com/BlueJayLouche/rustjay-engine" }
nokhwa-bindings-macos = { git = "https://github.com/BlueJayLouche/rustjay-engine" }
// src/main.rs
use rustjay_engine::prelude::*;

struct MyEffect;

#[repr(C)]
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
struct MyUniforms { intensity: f32 }

#[derive(Default, serde::Serialize, serde::Deserialize)]
struct MyState { intensity: f32 }

impl EffectPlugin for MyEffect {
    type State    = MyState;
    type Uniforms = MyUniforms;

    fn app_name(&self) -> &str { "my-effect" }
    fn shader_source(&self) -> &'static str { include_str!("shaders/my_effect.wgsl") }
    fn build_uniforms(&self, s: &MyState, _e: &EngineState) -> MyUniforms {
        MyUniforms { intensity: s.intensity }
    }
}

fn main() -> anyhow::Result<()> {
    env_logger::init();
    rustjay_engine::run(MyEffect)
}

That's it โ€” two windows open: a fullscreen GPU output and a tabbed control panel with input, audio, LFO, MIDI, OSC, presets, and output built in.

See the guide for a full walkthrough.

Running the examples

git clone https://github.com/BlueJayLouche/rustjay-engine
cd rustjay-engine
cargo run -p template      # HSB colour (reference)
cargo run -p delta         # RGB delay / motion extraction
cargo run -p delta-egui    # Same effect, egui backend
cargo run -p flux          # Optical-flow warp
cargo run -p waaaves       # Multi-pass feedback pipeline
cargo run -p sputnik       # Mesh displacement (Rutt-Etra style)
cargo run -p isf-example   # Load any .fs ISF shader at runtime
cargo run -p mixer         # 2-channel compositor
cargo run -p projection    # Projection mapping
cargo run -p videowall     # HDMI-matrix / video-wall mapper
cargo run -p vp404         # SP-404-style video sampler
cargo run -p webapp        # Web control panel (open http://localhost:3000)

# Standalone CV LED-mapping tool (calibrate addressable strips over sACN):
cargo run -p ledmap-studio

Keyboard shortcuts (output window):

  • Shift+F โ€” toggle fullscreen
  • Shift+T โ€” tap tempo
  • Shift+F1โ€“F8 โ€” recall preset quick-slots
  • Escape โ€” quit

Platform requirements

Platform Notes
macOS Metal GPU. Syphon I/O via syphon-core / syphon-wgpu 0.2 โ€” framework bundled, no separate install needed.
Windows Vulkan, DX12 fallback (force with WGPU_BACKEND=dx12). Spout I/O via DirectX interop.
Linux Vulkan. V4L2 loopback output.

NDI needs the ndi feature (off by default) and, at run time, the NDI 6 runtime โ€” from NDI Tools or the NDI SDK. Building needs nothing NDI-specific; without the runtime, NDI sources simply don't appear.

Warning

AMD on Windows: turn off Radeon Enhanced Sync. With it on, the AMD driver crashes the app (STATUS_HEAP_CORRUPTION, 0xc0000374, inside amdxc64.dll) as soon as several windows present while an output is fullscreen, e.g. a fullscreen projector plus both KOVVBOJ deck preview windows. The crash is in the driver and happens on both DX12 and Vulkan. Turn it off in AMD Software under Gaming โ†’ Graphics, or only for the app via Gaming โ†’ Games โ†’ โ‹ฎ โ†’ Add a Game.

Tempo sync

The engine supports three tempo sources, selected by the user at runtime from the Audio tab.

Enabling features

rustjay-engine = { git = "...", features = ["link", "prodj", "mtc"] }
Source Feature What it uses
Audio / Tap Tempo (always on) Real-time beat detection from audio input, or tap-tempo
Ableton Link link Joins the local Link session โ€” syncs with Live, Serato, Traktor, etc.
ProDJ Link prodj BPM, beat phase, and track metadata from CDJ/XDJ/DJM gear
MIDI Timecode mtc SMPTE position reference from any connected DAW

Using sync in a plugin

Use effective_bpm() and effective_beat_phase() โ€” they dispatch on whichever source is active:

fn build_uniforms(&self, s: &MyState, engine: &EngineState) -> MyUniforms {
    MyUniforms {
        bpm:        engine.effective_bpm(),
        beat_phase: engine.effective_beat_phase(),
    }
}

Build requirements

  • link: CMake โ‰ฅ 3.14 (brew install cmake). Links against Ableton Link โ€” binary becomes GPL-2.0+.
  • prodj: No extra deps. Binds UDP 50000/50002 โ€” get operator approval on production DJ networks.
  • mtc: No extra deps.

Architecture notes

  • EngineState is shared via Arc<Mutex<EngineState>> between the main thread, GUI, and background services
  • All I/O device enumeration (webcam, audio, NDI) runs in a background thread โ€” GPU render loop never blocks
  • Syphon server discovery runs on the main thread (singleton requirement) before the background thread spawns

Roadmap

Phase Status Description
1 โœ… Port rustjay-template into a structured workspace
2 โœ… EffectPlugin trait โ€” bring your own shader and uniforms
3 โœ… Multi-input compositor, custom GUI tabs
4 โœ… API stabilisation, docs, example gallery
5 โœ… Indexed mesh geometry + vertex-shader displacement (sputnik)
6 โœ… Ableton Link + ProDJ Link tempo sync
SG-6 โœ… MIDI Timecode, explicit sync source selector, LFO beat-phase fix
7 โœ… ISF shader viewer, web remote, egui backend, user guide
8 โœ… Windows support โ€” Spout I/O, NDI robustness, CI
9 โœ… Layer-based VJ app โ€” mixer, FX chains, scene topology persistence (now KOVVBOJ, its own repo)
10 โœ… Projection mapping โ€” output post-processor, headless NDI/Syphon/Spout/V4L2 sinks
11 โœ… DMX lighting output โ€” sACN / Art-Net with per-fixture pixel sampling

Stretch goals: hot-reload plugins, timeline/sequencer, KOVVBOJ full-parity port.

Related projects

  • CuePool โ€” show-control cue player. It lived in examples/cuepool/ until it was extracted into its own repository with its full history. The only tie left is rustjay-lighting, which CuePool consumes from crates.io, so a local change to crates/rustjay-lighting does not reach CuePool until it is published.

License

MIT

About

Bevy for VJs

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages