muscriptor2sky 1.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- muscriptor2sky-1.4.1/LICENSE +21 -0
- muscriptor2sky-1.4.1/PKG-INFO +422 -0
- muscriptor2sky-1.4.1/README.md +397 -0
- muscriptor2sky-1.4.1/muscriptor2sky/__init__.py +50 -0
- muscriptor2sky-1.4.1/muscriptor2sky/__main__.py +6 -0
- muscriptor2sky-1.4.1/muscriptor2sky/cli.py +183 -0
- muscriptor2sky-1.4.1/muscriptor2sky/core.py +1141 -0
- muscriptor2sky-1.4.1/muscriptor2sky/py.typed +0 -0
- muscriptor2sky-1.4.1/muscriptor2sky.egg-info/PKG-INFO +422 -0
- muscriptor2sky-1.4.1/muscriptor2sky.egg-info/SOURCES.txt +14 -0
- muscriptor2sky-1.4.1/muscriptor2sky.egg-info/dependency_links.txt +1 -0
- muscriptor2sky-1.4.1/muscriptor2sky.egg-info/entry_points.txt +3 -0
- muscriptor2sky-1.4.1/muscriptor2sky.egg-info/requires.txt +3 -0
- muscriptor2sky-1.4.1/muscriptor2sky.egg-info/top_level.txt +1 -0
- muscriptor2sky-1.4.1/pyproject.toml +54 -0
- muscriptor2sky-1.4.1/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 eeesssr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: muscriptor2sky
|
|
3
|
+
Version: 1.4.1
|
|
4
|
+
Summary: 把 MIDI 转换成光遇(Sky: Children of the Light)15 键琴谱 txt,兼容 SkyStudio
|
|
5
|
+
Author: eeesssr
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/eeesssr/muscriptor2sky
|
|
8
|
+
Project-URL: Repository, https://github.com/eeesssr/muscriptor2sky
|
|
9
|
+
Project-URL: Issues, https://github.com/eeesssr/muscriptor2sky/issues
|
|
10
|
+
Keywords: sky-children-of-the-light,skystudio,sky-music,sky-sheet,music-transcription,midi,midi-to-sheet,muscriptor,mt3,amt,kalimba
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: MIDI
|
|
18
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# muscriptor2sky
|
|
27
|
+
|
|
28
|
+
把 MIDI 文件转成光遇 15 键琴谱,输出 SkyStudio 能直接读的 `.txt` 格式。也支持反向转换,把琴谱还原成 MIDI。
|
|
29
|
+
|
|
30
|
+
这个工具接受任何标准 MIDI 文件——DAW 导出的、手写的、MuScriptor/MT3 转谱的都可以。生成的琴谱能被 SkyStudio 和各种光遇弹琴工具直接使用。
|
|
31
|
+
|
|
32
|
+
**两种用法**
|
|
33
|
+
|
|
34
|
+
| 方式 | 适合谁 | 怎么用 |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| 🌐 **网页版** | 手机 / 不想装 Python | 打开网页 → 选文件 → 下载 `.txt` |
|
|
37
|
+
| 💻 **命令行** | 批量处理 / 脚本集成 | `python -m muscriptor2sky song.mid` |
|
|
38
|
+
|
|
39
|
+
网页版是**纯前端**的:文件在你自己的浏览器里处理,**不会上传到任何服务器**。
|
|
40
|
+
代码里不存在任何上传路径,断网也能用。
|
|
41
|
+
|
|
42
|
+
**主要特性**
|
|
43
|
+
- 兼容 SkyStudio 格式标准(UTF-16LE + BOM)
|
|
44
|
+
- 零依赖,只用 Python 标准库
|
|
45
|
+
- 自动移调,让旋律尽量落在 15 个白键上
|
|
46
|
+
- 黑键智能吸附到最近的白键
|
|
47
|
+
- 内置格式校验(`--verify`)
|
|
48
|
+
- 支持双向转换
|
|
49
|
+
- 网页版与命令行版**逐字节等价**(109 个夹具用例交叉验证)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 网页版(推荐给手机用户)
|
|
54
|
+
|
|
55
|
+
直接用浏览器打开:
|
|
56
|
+
|
|
57
|
+
**https://eeesssr.github.io/muscriptor2sky/**
|
|
58
|
+
|
|
59
|
+
三步:
|
|
60
|
+
|
|
61
|
+
1. 把 `.mid` 文件拖进虚线框(手机上是点一下选文件)
|
|
62
|
+
2. 点「转换」
|
|
63
|
+
3. 点「下载 .txt」
|
|
64
|
+
|
|
65
|
+
> **隐私**:所有计算都在你的浏览器里完成。文件不会离开你的设备,
|
|
66
|
+
> 也不会产生任何网络请求。这不是承诺,是架构决定的 —— 页面没有任何上传代码。
|
|
67
|
+
>
|
|
68
|
+
> 网页版支持 PWA,在手机浏览器里「添加到主屏幕」后可以离线使用。
|
|
69
|
+
|
|
70
|
+
网页版和命令行版跑的是同一套算法。`web/sky-core.js` 是 `core.py` 的逐字节移植,
|
|
71
|
+
由 109 个基准夹具用例保证两者输出完全一致(见 [web/API.md](web/API.md))。
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 安装
|
|
76
|
+
|
|
77
|
+
需要 Python 3.8+。克隆后直接用:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git clone https://github.com/eeesssr/muscriptor2sky.git
|
|
81
|
+
cd muscriptor2sky
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
或者装成命令行工具:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install -e .
|
|
88
|
+
muscriptor2sky --help
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 快速上手
|
|
94
|
+
|
|
95
|
+
### 命令行
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# 最简单:生成同名 .txt
|
|
99
|
+
python -m muscriptor2sky song.mid
|
|
100
|
+
|
|
101
|
+
# 推荐:带上曲名作者,顺便自检
|
|
102
|
+
python -m muscriptor2sky song.mid -n "晴天" -a "周杰伦" --verify
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Windows 拖拽
|
|
106
|
+
|
|
107
|
+
把 `.mid` 文件拖到 `.bat` 上就行。仓库里有三个:
|
|
108
|
+
|
|
109
|
+
| 文件 | 说明 | 适用场景 |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| `转换-C调默认.bat` | 标准输出,15 键白键 | ⭐ 大部分情况用这个 |
|
|
112
|
+
| `转换-定调版.bat` | 交互选调 | 乐器调在别的调时用 |
|
|
113
|
+
| `转换-虚音版.bat` | 实验性输出 | 研究用,见 [虚音说明](docs/虚音说明.md) |
|
|
114
|
+
|
|
115
|
+
详细说明看 [定调与 pitchLevel](docs/定调与pitchLevel.md)。
|
|
116
|
+
|
|
117
|
+
### Python API
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import types
|
|
121
|
+
from muscriptor2sky.core import read_midi, midi_to_sky, write_sky
|
|
122
|
+
|
|
123
|
+
args = types.SimpleNamespace(
|
|
124
|
+
root=60, transpose="auto", grid=0.25, max_poly=0,
|
|
125
|
+
name="晴天", author="", arranged=None, transcribed=None,
|
|
126
|
+
bpm=None, bits_per_page=16, pitch_level=0, encoding="utf-16",
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
m = read_midi("song.mid")
|
|
130
|
+
notes, info = midi_to_sky(m, args)
|
|
131
|
+
write_sky("song.txt", notes, args, info)
|
|
132
|
+
print(info["stat"]) # 转换统计
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 15 键与简谱对照
|
|
138
|
+
|
|
139
|
+
光遇键名从 0 开始计数:
|
|
140
|
+
|
|
141
|
+
| 键名 | 位置 | 简谱 |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `1Key0` ~ `1Key6` | 1–7 | `1 2 3 4 5 6 7` |
|
|
144
|
+
| `1Key7` ~ `1Key13` | 8–14 | `1' 2' 3' 4' 5' 6' 7'` |
|
|
145
|
+
| `1Key14` | 15 | `1''` |
|
|
146
|
+
|
|
147
|
+
对应 MIDI 音高 C4(60) ~ C6(84)。
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 输出统计解读
|
|
152
|
+
|
|
153
|
+
运行后会显示:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
输入: song.mid
|
|
157
|
+
音域: 15 键 C 大调 C(60) ~ C(84)
|
|
158
|
+
移调: -2 半音 bpm: 120 源音符: 34 鼓(丢弃): 16
|
|
159
|
+
映射: 精确 14 / 八度折叠 12 / 半音吸附 6 / 同键合并 2 / 超复音丢弃 0
|
|
160
|
+
输出音符: 32
|
|
161
|
+
[格式自检] 通过,可直接被 APP 播放
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**关键指标**:
|
|
165
|
+
- **精确**: 音高正好落在白键上(越高越好)
|
|
166
|
+
- **半音吸附**: 黑键吸到白键(太多会走样)
|
|
167
|
+
- **八度折叠**: 超音域的音移了八度(少量正常)
|
|
168
|
+
- **主旋律保留**: 每个时刻的最高音有多少真的写进了谱面(应为 100%)
|
|
169
|
+
- **最大复音**: 同时按几个键(>4 手弹不了)
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 常用参数
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# 限制复音,适合密集的钢琴曲
|
|
177
|
+
python -m muscriptor2sky song.mid --max-poly 3
|
|
178
|
+
|
|
179
|
+
# 只要主旋律
|
|
180
|
+
python -m muscriptor2sky song.mid --max-poly 1
|
|
181
|
+
|
|
182
|
+
# 更细的网格,适合十六分音符
|
|
183
|
+
python -m muscriptor2sky song.mid --grid 0.125
|
|
184
|
+
|
|
185
|
+
# 保持原调不移调
|
|
186
|
+
python -m muscriptor2sky song.mid --transpose none
|
|
187
|
+
|
|
188
|
+
# 换音域(从 A3 开始)
|
|
189
|
+
python -m muscriptor2sky song.mid --root 57
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
完整参数列表:
|
|
193
|
+
|
|
194
|
+
| 参数 | 默认 | 说明 |
|
|
195
|
+
|---|---|---|
|
|
196
|
+
| `-o, --out` | 同名 .txt | 输出路径 |
|
|
197
|
+
| `-n, --name` | 文件名 | 曲名 |
|
|
198
|
+
| `-a, --author` | 空 | 作者 |
|
|
199
|
+
| `--arranged` | 空 | 编曲者(写入 `arrangedBy`) |
|
|
200
|
+
| `--transcribed` | 空 | 转谱者(写入 `transcribedBy`)。默认留空,不预设工具名 |
|
|
201
|
+
| `--bpm` | MIDI 速度 | 只影响编辑器显示 |
|
|
202
|
+
| `--pitch-level` | 0 | 定调(0=C 调) |
|
|
203
|
+
| `--root` | 60 | 最低键音高 |
|
|
204
|
+
| `--transpose` | `auto` | 自动移调 |
|
|
205
|
+
| `--grid` | 0.25 | 量化网格 |
|
|
206
|
+
| `--max-poly` | 0 | 复音上限 |
|
|
207
|
+
| `--verify` | 关 | 格式自检 |
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 反向转换
|
|
212
|
+
|
|
213
|
+
把琴谱转回 MIDI,用来核对或听听效果:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
python -m muscriptor2sky "晴天.txt" -o 晴天.mid
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 完整工作流:音频转琴谱
|
|
222
|
+
|
|
223
|
+
本工具只做 MIDI -> 琴谱这一段。音频转 MIDI 需要上游工具,下面两个都可以:
|
|
224
|
+
|
|
225
|
+
| 上游工具 | 地址 | 特点 |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| **MuScriptor** | [muscriptor.kyutai.org](https://muscriptor.kyutai.org/) | 网页版直接上传音频,也可本地跑 CLI |
|
|
228
|
+
| **听谱 Hearscore** | [hear-score.lirentech.net](https://hear-score.lirentech.net/) | 浏览器本地识别 MP3/WAV,带钢琴卷帘、变速试听,导出 MIDI/JSON |
|
|
229
|
+
|
|
230
|
+
两个都免费、都在本地或可本地处理。同一段音频用不同工具转出的 MIDI 会有差异,
|
|
231
|
+
哪个在 15 键上听着更像原曲就用哪个。
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# 1. 用 MuScriptor 把音频转成 MIDI(也可用 Hearscore 网页导出 .mid)
|
|
235
|
+
# 用 --instruments 只要钢琴轨
|
|
236
|
+
muscriptor transcribe --model medium --instruments "acoustic_piano" audio.wav -o piano.mid
|
|
237
|
+
|
|
238
|
+
# 2. 转成光遇琴谱
|
|
239
|
+
# --transcribed 记录「谁把音频转成的 MIDI」,这一步是 MuScriptor 就用它
|
|
240
|
+
# 用 Hearscore 转的就写 --transcribed Hearscore
|
|
241
|
+
python -m muscriptor2sky piano.mid -n "曲名" -a "作者" --transcribed MuScriptor --verify
|
|
242
|
+
|
|
243
|
+
# 3. 把 .txt 传到手机
|
|
244
|
+
# Android: /sdcard/skyMusicAuto/
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 批量转换
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# PowerShell
|
|
253
|
+
Get-ChildItem *.mid | ForEach-Object {
|
|
254
|
+
python -m muscriptor2sky $_.FullName --verify --no-preview
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
# bash
|
|
258
|
+
for f in *.mid; do python -m muscriptor2sky "$f" --verify --no-preview; done
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 示例文件
|
|
264
|
+
|
|
265
|
+
[`examples/flower-dance/`](examples/flower-dance/) 里有个完整样例,可以用来验证工具行为:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
python -m muscriptor2sky examples/flower-dance/input.mid \
|
|
269
|
+
-o out.txt -n "DJ OKAWARI - Flower Dance" --verify
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
预期输出:
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
移调: +1 半音 bpm: 319 源音符: 2584 鼓(丢弃): 945
|
|
276
|
+
映射: 精确 1570 / 八度折叠 627 / 半音吸附 48 / 同键合并 339 / 超复音丢弃 0
|
|
277
|
+
输出音符: 2245
|
|
278
|
+
定调: pitchLevel = 0(C 调,谱面按 15 键白键书写)
|
|
279
|
+
[可弹性] 旋律可用 15 键弹奏的比例 98.1%
|
|
280
|
+
[主旋律] 1314/1314 保留(100.0%)
|
|
281
|
+
时间网格: 单位 1 拍 = 188 ms [SkyStudio 兼容]
|
|
282
|
+
[格式自检] 编码 UTF-16LE(BOM) | 音符 2245 | 事件 1313 | 最大复音 6 | 时长 318.3s
|
|
283
|
+
[格式自检] 通过,可直接被 APP 播放
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 工作原理
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
读 MIDI(跳过打击乐) → 提取旋律(每个时刻的最高音) →
|
|
292
|
+
搜索最佳移调量 → 八度折叠 → 黑键吸附 →
|
|
293
|
+
同键合并 → 时间量化 → 写 UTF-16LE+BOM
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 移调算法
|
|
297
|
+
|
|
298
|
+
在 ±18 半音(3 个八度)内搜索,目标是让整条旋律尽量完整地落进 C4~C6 音域。这比简单统计"白键命中率"更准确——后者会把大量音挤出音域,再逐个折叠,导致旋律中断。
|
|
299
|
+
|
|
300
|
+
实测效果(178 份社区谱面):回环还原率从 96.1% 提升到 99.89%。
|
|
301
|
+
|
|
302
|
+
### 黑键吸附
|
|
303
|
+
|
|
304
|
+
每个黑键音级统一朝一个方向吸附,而不是逐音决定。这样同一个音级在整首曲子里总是落到同一个白键上,避免"同一句旋律重奏时音名变了"的问题。
|
|
305
|
+
|
|
306
|
+
实测星降る海:修复前 C# 被映射到 G/A/B 三个不同白键,修复后固定一个。
|
|
307
|
+
|
|
308
|
+
### SkyStudio 时间模型
|
|
309
|
+
|
|
310
|
+
SkyStudio 要求 `gcd(time 间隔) == 60000/bpm`,否则播放速度会变。工具会自动调整 bpm 来满足这个条件,保证速度准确。
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 常见问题
|
|
315
|
+
|
|
316
|
+
**Q: 播放出来低了一个音?**
|
|
317
|
+
键名是 0 基的,第一键是 `1Key0` 不是 `1Key1`。
|
|
318
|
+
|
|
319
|
+
**Q: skyR 能播,SkyStudio 报错?**
|
|
320
|
+
这是时间网格问题,v1.2 已修复。用 `--verify` 自检。
|
|
321
|
+
|
|
322
|
+
**Q: 旋律跑调?**
|
|
323
|
+
看输出里的"半音吸附"占比。如果很高,说明原曲大量用黑键,15 键琴物理上弹不出来。这是乐器限制,不是转换错误。
|
|
324
|
+
|
|
325
|
+
判断标准:
|
|
326
|
+
- < 5%: 转换基本忠实
|
|
327
|
+
- 5~15%: 有明显改动
|
|
328
|
+
- \> 15%: 建议换曲或接受改编
|
|
329
|
+
|
|
330
|
+
**Q: 和弦太密弹不了?**
|
|
331
|
+
用 `--max-poly 3` 或 `--max-poly 1` 限制复音。
|
|
332
|
+
|
|
333
|
+
**Q: 中文乱码(Windows)?**
|
|
334
|
+
PowerShell 里先 `$env:PYTHONIOENCODING='utf-8'`,或直接用 `.bat` 文件。
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 版本历史
|
|
339
|
+
|
|
340
|
+
### 网页版 1.5.0_web(不计入主仓库版本)
|
|
341
|
+
- 新增纯前端网页版:浏览器内完成转换,文件不上传,支持手机与离线(PWA)
|
|
342
|
+
- `web/sky-core.js` 是 `core.py` 的 1:1 JavaScript 移植,与命令行版逐字节等价
|
|
343
|
+
- 新增 109 个基准夹具用例,Python 与 JS 双端交叉校验
|
|
344
|
+
- 新增 GitHub Pages 自动部署与 CI(见 `.github/workflows/`)
|
|
345
|
+
- 命令行行为完全不变
|
|
346
|
+
|
|
347
|
+
> **关于版本号**:网页版只是同一套算法的另一个入口,**不算主仓库的功能更新**,
|
|
348
|
+
> 所以它有自己的编号 `1.5.0_web`,与 Python 包的版本号分开走。
|
|
349
|
+
> 主仓库最新版本仍是 v1.4.1。
|
|
350
|
+
>
|
|
351
|
+
> 另外,早期自适应定调实验版曾占用过 v1.5.0 / v1.5.1 的 tag,
|
|
352
|
+
> 那些提交保留在 `archive/auto-key` 分支上,从未进入 `main`,该编号作废。
|
|
353
|
+
|
|
354
|
+
### v1.4.1 — 主旋律完整保留
|
|
355
|
+
- 修复主旋律在复音限制和同键合并时被丢弃的问题
|
|
356
|
+
- 实现优先级算法:主旋律永远优先保留,伴奏按显著性排序
|
|
357
|
+
- 主旋律存活率提升(5 份实测曲目,v1.4.0 → v1.4.1):
|
|
358
|
+
|
|
359
|
+
| 曲目 | 修复前 | 修复后 |
|
|
360
|
+
|---|---|---|
|
|
361
|
+
| 蝴蝶 | 89.8% | **100%** |
|
|
362
|
+
| Flower Dance | 97.4% | **100%** |
|
|
363
|
+
| 星降る海 | 98.0% | **100%** |
|
|
364
|
+
| 纯蓝 | 99.3% | **100%** |
|
|
365
|
+
| DAMIDAMI | 98.2% | **100%** |
|
|
366
|
+
|
|
367
|
+
- 默认路径(`--max-poly 0`)输出与 v1.4.0 逐音符一致,无回归
|
|
368
|
+
- 新增 `info["melody"]` 字段,可在代码里直接读到主旋律存活率
|
|
369
|
+
- 感谢 Claude(Anthropic) 的贡献
|
|
370
|
+
|
|
371
|
+
### v1.4.0 — 三种输出模式
|
|
372
|
+
- 分离为三条独立路径:C 调默认、定调版、虚音版
|
|
373
|
+
- 新增"可弹性"指标
|
|
374
|
+
- 修正了关于 `pitchLevel` 的理解
|
|
375
|
+
|
|
376
|
+
### v1.3.1 — 黑键吸附方向统一
|
|
377
|
+
- 修复同一音级映射到不同白键的问题
|
|
378
|
+
- 音级轮廓保真度 82.4% → 83.9%
|
|
379
|
+
|
|
380
|
+
### v1.3.0 — 旋律保真度修复
|
|
381
|
+
- 搜索范围扩展到 ±18 半音
|
|
382
|
+
- 旋律音正确率 74.4% → 82.0%
|
|
383
|
+
- 回环还原率 96.1% → 99.89%
|
|
384
|
+
|
|
385
|
+
### v1.2.0 — SkyStudio 时间网格修复
|
|
386
|
+
- 修复"skyR 能播、SkyStudio 报错"的问题
|
|
387
|
+
- 保证 `gcd(time) == 60000/bpm`
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## 开发
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
# Python 测试
|
|
395
|
+
python run_tests.py
|
|
396
|
+
# 或用 pytest
|
|
397
|
+
pip install pytest && pytest
|
|
398
|
+
|
|
399
|
+
# 网页版与命令行版的逐字节一致性测试
|
|
400
|
+
python tools/gen_fixtures.py # 用 Python 生成基准夹具
|
|
401
|
+
node --test web/tests/ # JS 实现必须全部通过
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
测试覆盖:音高映射、键位约定、MIDI 解析、黑键吸附、复音限制、主旋律保留、编码、往返一致性。
|
|
405
|
+
|
|
406
|
+
网页版核心 `web/sky-core.js` 不依赖任何 npm 包,也不需要用构建工具 ——
|
|
407
|
+
直接用 `<script>` 引入即可,双击 `web/index.html` 就能在本地跑。
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## 致谢
|
|
412
|
+
|
|
413
|
+
- [SkyStudio](https://play.google.com/store/apps/details?id=com.Maple.SkyStudio) — 光遇琴谱编辑器标准
|
|
414
|
+
- [MuScriptor](https://huggingface.co/MuScriptor/muscriptor-small) — 开放权重模型(非商业许可)
|
|
415
|
+
- [听谱 Hearscore](https://hear-score.lirentech.net/) — 浏览器本地音频转 MIDI 工具
|
|
416
|
+
- [skyR](https://github.com/iKeilo/skyR) — 开源光遇弹琴实现
|
|
417
|
+
- [SkyAutoPlayerScript](https://github.com/StageGuard/SkyAutoPlayerScript) — 提供社区谱面验证
|
|
418
|
+
|
|
419
|
+
## 许可
|
|
420
|
+
|
|
421
|
+
[MIT](LICENSE)
|
|
422
|
+
本项目为独立第三方工具,与 Mirelo / Kyutai 无关联,未获其背书
|