Skip to content

CapRust 0.5.0-alpha.1 — CLAP plugins, MCP server, xfade drift fix

Pre-release
Pre-release

Choose a tag to compare

@Domica Domica released this 29 Sep 15:06
· 66 commits to main since this release

Added

  • CLAP plugin hosting. CapRust scans the two standard CLAP
    folders (C:\Program Files\Common Files\CLAP and
    %APPDATA%\CapRust\plugins) and lists every .clap binary in a
    new Plugins tab in the asset browser. The scan is feature-gated
    behind clap so Linux CI without the CLAP SDK still builds.
    Plugin binaries are untrusted code; every load is wrapped in
    catch_unwind.
  • Master plugin chain. ProjectState.master_plugins: Vec<PluginInstance>. A + on any plugin card adds it to the
    chain. A new Master dock tab shows the active chain with
    per-instance Bypass and Remove. All mutations go through the
    undo stack (AddMasterPluginCommand, RemoveMasterPluginCommand,
    SetPluginParamCommand). render_hash includes the chain so any
    change respawns the preview.
  • CLAP audio processing. The master chain runs on the PCM
    reader thread, between the ffmpeg decode and the cpal ring
    buffer. Interleaved stereo is deinterleaved to planar, processed
    by each plugin in turn, then reinterleaved. Verified against
    u-he ZebraHZ 2.9.4 on Windows: loads, activates, and processes
    a test sine without NaN.
  • MCP server. caprust-mcp.exe is a standalone binary crate.
    Line-delimited JSON-RPC 2.0 on stdio; loads a .caprust project
    file and exposes read-only inspection plus mutating tools. 15
    tools total: get_project_summary, list_tracks, list_clips,
    list_media, add_media, add_clip_to_timeline, move_clip,
    split_clip, set_transition, set_clip_volume,
    set_clip_speed, set_clip_fade, undo, redo,
    save_project. Every mutating tool goes through UndoStack,
    same as the UI. No tokio, no rmcp — 200-line hand-rolled
    dispatch.
  • AddMediaCommand in core (was missing for the MCP
    add_media tool to satisfy DIRECTIVES 6).
  • docs/mcp.md with a Claude Desktop config template, tool
    reference, and known limits.
  • Drift logger. The periodic preview state INFO line now
    shows audio_ms=Some(N) delta=Some(N) — sample-counter position
    and the ms distance between playhead and audio. Handy for
    future sync regressions.

Fixed

  • Xfade audio drift in preview. The audio player started on
    the Play click, but the playhead anchors only on the first
    consumed video frame. A project without any transition delivered
    that frame in ~370 ms, so audio and playhead stayed in step. A
    project with an xfade or slide forces ffmpeg to decode both
    clips from their beginning to build the blend; the first frame
    arrived 2.2–2.4 s later. By then audio was already 2.2–2.4 s
    ahead of the playhead, and every sync log showed the same fixed
    delta (measured: 2285 ms fade, 2422 ms slide). Fix: audio is now
    deferred until the first frame is consumed. Audio and playhead
    both start from the same position, so audio_baseline is near
    zero regardless of transition complexity.
  • SetTransitionCommand clamp. The model shifted followers
    by the raw transition_duration_ms; the render clamps to half
    of the shorter clip. For a 3000 ms slide on a 4 s clip the model
    shifted 3000 ms while the render shortened by 2000 ms, adding a
    1000 ms gap after the transition. The model now uses the same
    clamp as the render.
  • commands.rs module ordering. Doc comment / pub mod order
    was fragile; the module list is now always below the doc block.

Changed

  • crates/mcp/Cargo.toml switched from a hardcoded version
    to version.workspace = true, so a release bump touches one
    place.

Known issues

  • CLAP bypass toggle is not undoable. Bypass flips the field
    in place; Ctrl+Z does not restore it. Remove and add are
    undoable as usual.
  • CLAP scan paths are fixed. Two directories only
    (C:\Program Files\Common Files\CLAP, %APPDATA%\CapRust\plugins).
    Custom paths in Settings are a follow-up.
  • Deferred audio start adds silence at the top of playback.
    With a transition in the project, audio begins ~2–3 s after you
    press Play, matching when the first frame arrives. Without a
    transition the gap is ~370 ms.
  • Transition easing is stored but not rendered. The EaseCurve
    on each clip is preserved in the project file, but the pinned
    ffmpeg build (gyan.dev essentials 2026-01-26) does not support
    fade=curve=. Renders emit plain linear fades.
  • MCP is single-session. No live sync with a running GUI yet.
  • No installer yet; download the nightly ZIP and extract it.
  • FFmpeg is not bundled. First run offers to download a BtbN
    build or to point at an existing install.
  • Windows only.
  • Text overlay rotation is stored in the model but neither
    rendered nor exposed in the UI.
  • YuNet face detection loads and runs but never fires
    detections on real frames. SCRFD is the primary detector.