Zum Hauptinhalt springen
H

dsh-plugin-keyboard-score

hutao48/dsh-plugin-keyboard-score

Windsong Lyre keyboard-score rules for Genshin. Maps notes to the 21 lyre keys, validates score text against the notation rules, and converts between 简谱 and key letters; ships one skill and a keyboard_score tool.

Installation

dsh plugin --profile web add github:hutao48/dsh-plugin-keyboard-score

README

键盘谱规则(dsh-plugin-keyboard-score)

把「原神风物之诗琴键盘谱」的命名规则做成 DeepSeek Harness(DSH)插件:装上后任何会话都能直接校验、互转、查询键盘谱,并可按需加载规则技能。

dsh-plugin

安装

在 DSH 里安装(从 GitHub 源码安装,无需 npm 发布):

dsh plugin add github:hutao48/dsh-plugin-keyboard-score

也可以写完整仓库地址:

dsh plugin add https://github.com/hutao48/dsh-plugin-keyboard-score

本地开发时,直接用 plugin_manager 装目录(本地目录会以 link: 方式接入,改代码即时生效):

plugin_manager action=install_bundle target=<本目录绝对路径>

安装后:技能 keyboard-score-rules 出现在会话技能目录,工具 keyboard_score 进入工具列表。卸载:

dsh plugin remove dsh-plugin-keyboard-score

或 plugin_manager action=remove_bundle target=dsh-plugin-keyboard-score。

它提供什么

组成说明
技能 keyboard-score-rules规则总览:21 键三排映射、圆括号和弦、/ 分拍、六段命名、V1–V10 校验、简谱 ↔ 键盘谱互转语法
工具 keyboard_score5 个动作:reference 速查卡、validate 校验+统计、convert 简谱↔键盘谱、read 读随附文档、list 资源清单
knowledge/键盘谱命名规则.md完整分析报告 + 规范(R1–R20、C1–C6、V1–V10、完整 120 行原谱、附录)
knowledge/keyboard_score_raw.txt原谱纯文本(120 行 / 6 段 / 545 拍位 / 446 个和弦)

工具用法

动作调用示例返回
速查keyboard_score { "action": "reference" }键位表、语法、规则编号、简谱输入语法、常用和弦
校验keyboard_score { "action": "validate", "score": "(CMD) / / /J J /J /H J /" }逐段统计 + V1–V10 错误/警告
校验文件keyboard_score { "action": "validate", "path": "D:\\score.txt" }同上(路径 ≤ 512KB)
键位→简谱keyboard_score { "action": "convert", "direction": "keys_to_jianpu", "score": "..." }简谱度数文本 + 和弦对照表(含音名与和弦性质)
简谱→键位keyboard_score { "action": "convert", "direction": "jianpu_to_keys", "jianpu": "3_7_3 / 0 / 0 / 7 7 / 7 / 6 7 /" }键盘谱文本
读文档keyboard_score { "action": "read", "doc": "rules", "offset": 1, "limit": 120 }规则文档行区间(doc:rules / score / skill)
列资源keyboard_score { "action": "list" }随附文档清单与行数

规则速览

        高音区(上排)  Q W E R T Y U  =  1̇ 2̇ 3̇ 4̇ 5̇ 6̇ 7̇
        中音区(中排)  A S D F G H J  =  1  2  3  4  5  6  7
        低音区(下排)  Z X C V B N M  =  1̣ 2̣ 3̣ 4̣ 5̣ 6̣ 7̣
  • 单音 = 单字母;和弦 = 圆括号 + 连写,括号内按音高从低到高排序(如 3̣7̣3 → (CMD))
  • / 分隔拍,行内 / 数 = 拍数;空拍留空;行尾必须有 /;每 4 行一组
  • 段落固定顺序:第一段 → 第二段 → 主题 → 第三段 → 第四段 → 第五段
  • 禁用字母:I K L O P;简谱输入八度后缀:_/, 低、^/' 高
  • 校验项 V1–V10:键名、括号、升序、重复、音数、行尾、段落、字符集、空拍

目录结构

.
├── main.js                    # 插件入口:注册技能与工具
├── src/
│   ├── rules.js               # 21 键映射、音名与和弦分析
│   ├── score.js               # 谱面解析与 V1–V10 校验
│   ├── convert.js             # 键盘谱 ↔ 简谱互转
│   ├── reference.js           # 规则速查卡
│   ├── tool.js                # keyboard_score 工具
│   └── skills.js              # keyboard-score-rules 技能注册
├── skills/keyboard-score-rules.md
├── knowledge/                 # 完整规则文档与原谱
├── locale/{zh,en}.json        # 插件标题/描述
├── icon.svg · assets/icon-180.png
├── cordis.patch.yml           # dsh.bundle patch
└── test/smoke.mjs             # 本地冒烟测试(零依赖)

开发与测试

node test/smoke.mjs     # 或 npm test

测试覆盖:原谱校验(120 行 / 545 拍 / 655 事件 / 446 和弦)、六段顺序、键盘谱 ↔ 简谱互转、V1/V3/V6/V10 错误注入、技能与工具注册。零运行时依赖,仅用 Node 标准库。

限制

  • 规则来自对 B 站公开图文动态《纳塔 Natlan(风物之诗琴简谱+键盘谱)》的分析;原曲版权归 HOYO-MiX / 米哈游,简谱与键盘谱作者为「指尖灬旋律丿」(UID 76052941),来源:https://www.bilibili.com/opus/972925545602875401。knowledge/ 内的谱面与文档仅作学习性分析与格式整理。
  • 谱面体系固定为 C 大调 21 键;其他调素材需先按首调映射(1=C)再记写。
  • 简谱中灰色数字等辅助显示的语义、段落与小节的完整对应关系,本插件不作断言;具体演奏以原视频 BV1LvHsekEn2 为准。
  • 插件只读本地文件(自带资源 + 用户显式传入的 path),不联网。

English

A DeepSeek Harness plugin that packages the Windsong Lyre keyboard-score naming rules for Genshin Impact: a 21-key letter mapping, chord/beat/section syntax, V1–V10 validation, and 简谱 ↔ key-letter conversion.

dsh plugin add github:hutao48/dsh-plugin-keyboard-score

It registers one skill (keyboard-score-rules) and one tool (keyboard_score with actions reference, validate, convert, read, list), plus the full rule document and a sample score. Read-only, zero runtime dependencies.

License

Code and documentation are MIT licensed (see LICENSE). Bundled score transcriptions keep their original attribution as described above.

Ähnliche Plugins