Introduction¶
The most time-consuming part of preparing BGM for a TRPG session is matching a track to each scene and remembering which one goes where. This plugin turns that into a stateful pipeline: module text → segment list → 12 candidates per segment → audition / perceptual analysis / segment scoring → final selection → NetEase Cloud Music playlist + three documents.
What It Is¶
A DeepSeek Harness plugin maintained by fengnowuyu-beep. It reads a module, splits it into performance-ordered segments, retrieves 12 candidates per segment, runs local music2emo perceptual analysis, supports negative tags and vocal detection, provides an embedded workbench, and ultimately exports a NetEase Cloud Music playlist along with three documents.
Core Capabilities¶
- Segment Splitting: Reads the module and splits it into performance-ordered segments: scene, trigger points, light/dark / energy / texture / vocal presence / tension.
- Candidate Retrieval: 12 per segment. Playlist-first: hits curated playlists first, then fills gaps with song search. Ranking follows “source pool → keyword score → pool order.”
- Perceptual Analysis: Local music2emo analyzes the full track, outputs probabilities and V/A values for 56 Jamendo emotion descriptors, and computes a segment score based on the segment’s target weights.
- Negative Tags: Each segment can define “tags to suppress,” applying a multiplicative penalty to candidate scores.
- Vocal Detection: CLAP zero-shot classification to determine “whether anyone is singing.”
- Embedded Workbench: Audition, scrub progress, lock in a selection, edit a scene, re-search a single segment — all writing back to the same
cues.json. - Export: Create or reuse a playlist (module name-YYMMDD-author), export
review.md/playlist.txt/playlist.csv. - History: Every playlist ever created appears in the workbench’s “History” tab, where you can go back and continue editing.
Installation & Activation¶
- Clone the repository and install dependencies:
git clone https://github.com/fengnowuyu-beep/dsh-bgm-prep.git
cd dsh-bgm-prep
npm install
- Register it in your DSH profile (the profile directory is typically
~/.dsh/profiles/desktop):
pnpm add link:/absolute/path/dsh-bgm-prep
Or directly add a line to dependencies in the package.json of that directory:
"dsh-bgm-prep": "link:E:/path/to/dsh-bgm-prep"
- Restart DSH and enable it from the “Plugins” list. A “BGM Workbench” will appear in the sidebar.
Typical Workflow¶
- Provide input in the conversation: drop the module into the chat and say “BGM prep.”
- The agent produces a list: splits scenes → builds the table → retrieves → outputs a structured cue sheet.
- It prompts you to pick: the tool output always ends with “→ Head over to the sidebar’s ‘BGM Workbench’ to pick your tracks.”
- You make final selections in the workbench: audition, review auto-tags and match scores, click “Pick this one.”
- Return to the conversation to wrap up: say “Done picking,” and the agent creates the playlist and exports the documents.
- Revisit: The workbench’s “History” tab shows every playlist you’ve ever created.
Use Cases & Notes¶
Suitable for TRPG GMs or anyone who needs to curate scene-based music. The plugin runs with the current DSH process’s permissions — review the source code and license before installing. It depends on ncm-cli for NetEase Cloud Music search and playlist operations, which requires proper authentication.
In Closing¶
dsh-bgm-prep breaks a TRPG module down into a tagged cue sheet, provides an embedded workbench and NetEase Cloud Music playlist export, making it ideal for users who want a systematic approach to session music preparation. See the directory page and the GitHub link for more details.