Preface¶
When chatting about music with models in DeepSeek Harness (DSH), the common approach is to throw in a snippet of lyrics, a track name, or your own description of how it sounds. The model cannot hear the file itself, and it is hard to reconstruct arrangement, section structure, and rhythm from pure text. If you want the conversation to be grounded in verifiable facts — such as BPM, key, roughly when the chorus kicks in, or whether the low end is over-emphasized — you need to turn the audio into material the model can “see” first.
mukiyou/dsh-music-analyze (maintained by MukiyoU, categorized under Model Inference in the community) adds a music_analyze tool to DSH: it takes a local audio or video path as input and outputs a four-panel figure plus a set of textual metrics. Combined with read_image and the report field, the model can discuss structural and technical features of specific segments rather than offering vague generalities.
What Is This¶
In one sentence: it turns an audio/video path into four images + a set of numbers, so a multimodal model can look at the figures and data and then discuss the track with you.
The current plugin version is 0.2.0 (see the repo’s package.json), licensed under MIT. It cannot replace your listening experience — the README explicitly states: the figures show “what the music looks like”, not “whether it sounds good”; form can be measured, but the feeling still needs a human to listen and tell the model.
Core Features¶
Tool Output¶
After calling music_analyze, the main deliverables include:
- Four-panel figure (default
music_report.png): - Waveform: rhythmic accents, quiet and explosive sections
- Mel spectrogram: frequency distribution (approximate positions of bass, vocals, cymbals)
- Chromagram: 12 pitch classes, used for tonality and chord progressions (the README calls this the most critical figure when discussing music)
- Section energy: RMS per second, handy for spotting the boundaries between intro/verse/chorus
- Text metrics (in the returned
reportfield): duration, BPM, key; energy ratios for low/low-mid/mid-high/high/air bands; dynamic range (dB); the 5 loudest moments and the 3 quietest moments.
Optional parameters: start / end to analyze only a time range; label to write into the figure title; outDir to specify the output directory.
BPM Estimation (v0.2.0)¶
A single librosa beat_track tends to halve-speed (i.e., estimate double) the BPM on drumless solos. This plugin uses three independent estimators (dynamic-programming beat tracking, onset autocorrelation, and a cyclic beatogram), then decides whether to take the half-time based on the odd/even beat RMS intensity ratio; if the condition does not hold, the number stays unchanged, and the report records the candidates and the rationale. Drumless solo tracks may still be unreliable, in which case the tool flags bpmReliable: false.
Runtime Environment¶
- Node >= 18 (plugin host)
- Python-side dependencies: librosa, soundfile, matplotlib; video/some formats require ffmpeg (system PATH,
FFMPEG_BIN, orpip install imageio-ffmpeg) - Extracted audio is normalized to 22050Hz mono, aligned with librosa’s analysis parameters
Installation and Activation¶
The plugin runs a Python subprocess with the permissions of the current DSH process to analyze local files. Before installing, review the GitHub source and the MIT license yourself to confirm that the paths and dependencies fit your environment.
1. Install Python dependencies
For networks inside China, a mirror is recommended to avoid slow downloads of large packages like scipy / numba:
python -m pip install -i https://mirrors.aliyun.com/pypi/simple/ librosa soundfile matplotlib
2. Prepare ffmpeg (pick one of three)
- The system already has
ffmpegon PATH → no extra steps needed - Set the environment variable
FFMPEG_BINto point to the executable - Or
pip install imageio-ffmpeg
3. Install the plugin bundle
In DeepSeek Harness, use the official README syntax (do not use the name-assembled dsh plugin add):
plugin_manager install_bundle <absolute path to this directory>
You can also put the bundle into the profile’s bundles configuration. If not configured, the plugin tries python / python3 / py in order and runs an import librosa self-check against each interpreter.
Optional configuration (plugin Config)
pythonPath: 'C:\\path\\to\\venv\\Scripts\\python.exe' # specify interpreter
timeoutMs: 600000 # analysis timeout (ms)
Typical Usage¶
The model side calls the tool directly, for example:
music_analyze(path="D:\\Music\\song.mp3")
music_analyze(path="...", start=60, end=120) # only analyze 1:00–2:00
music_analyze(path="...", label="くじら") # figure title with a name
The README stresses: the model should use read_image to open the returned imagePath and look at the figure, then combine that with report for discussion; looking at numbers only and skipping the image loses most of the information.
Applicable Scenarios and Caveats¶
Good for: structured discussion of a local music library or MV files (sections, tempo, frequency bands, tonal center); when you need citable time points and figures.
Limitations (from the README’s “pitfalls we’ve stepped on”):
- Drumless piano/fingerstyle: BPM may double or be unreliable — watch
bpmReliable. - Special tunings: the key letter may be inaccurate; the chromagram is more reliable than the single key field.
- When discussing arrangement, prioritize the mel spectrogram; the waveform mainly reflects loudness.
- matplotlib Chinese titles depend on system fonts (it already tries YaHei / SimHei / PingFang SC / Noto Sans CJK); without fonts, the title may render as squares — this does not affect the curve data.
- If the same environment is used for MV speech transcription, faster-whisper’s VAD may filter out singing as music; transcription needs
--no-vadadded (note this when used alongside music analysis).
The DSH ecosystem is “everything is a plugin”; the SkillHub directory page is a community listing, with no official affiliation to DeepSeek / 幻方.
Links¶
- Community directory: https://www.skillhub.cn/plugins/MukiyoU/dsh-music-analyze
- Source code and documentation: https://github.com/MukiyoU/dsh-music-analyze