Appearance
MCMIDI JSON 结构(适用于GQ音乐编辑器)
完整结构
json
{
"format": "mcmidi",
"version": 1,
"title": "Twinkle Star",
"author": "traditional",
"tps": 30,
"bpm": 120,
"settings": {
"loop": false,
"default_target": "@a",
"default_position": [0, 0, 0]
},
"tracks": [
{
"id": "melody",
"name": "主旋律",
"instrument": "note.harp",
"volume": 1.0,
"enabled": true
}
],
"notes": [
{
"tick": 0,
"track": "melody",
"midi": 60,
"pitch": 1.0,
"volume": 1.0
}
],
"total_ticks": 690,
"total_seconds": 23
}顶层字段
| 字段 | 类型 | 作用 |
|---|---|---|
| format | string | 固定格式标识 |
| version | number | MCMIDI 版本 |
| title | string | 乐曲名称 |
| author | string | 作者 |
| tps | number | 每秒 Tick 数 |
| bpm | number | 乐曲 BPM |
| settings | object | 播放设置 |
| tracks | array | 轨道列表 |
| notes | array | 音符列表 |
| total_ticks | number | 总 Tick |
| total_seconds | number | 总时长(秒) |
settings(暂未启用,后续基本用命令参数替代)
json
{
"loop": false,
"default_target": "@a",
"default_position": [0, 0, 0]
}| 字段 | 类型 | 作用 |
|---|---|---|
| loop | boolean | 是否循环 |
| default_target | string | 默认播放目标 |
| default_position | array | 默认播放位置 |
tracks
json
{
"id": "melody",
"name": "主旋律",
"instrument": "note.harp",
"volume": 1.0,
"enabled": true
}| 字段 | 类型 | 作用 |
|---|---|---|
| id | string | 轨道唯一 ID |
| name | string | 轨道名称 |
| instrument | string | 默认乐器 |
| volume | number | 轨道音量 |
| enabled | boolean | 是否启用 |
notes
json
{
"tick": 0,
"track": "melody",
"midi": 60,
"pitch": 1.0,
"volume": 1.0
}| 字段 | 类型 | 作用 |
|---|---|---|
| tick | number | 播放 Tick |
| track | string | 所属轨道 |
| midi | number | MIDI 音高 |
| pitch | number | MC 音高倍率 |
| volume | number | 音量 |
Tick 示例
json
{
"tick": 30
}表示:
txt
第 30 Tick 播放当:
json
"tps": 30则:
txt
30 Tick = 1 秒Pitch 示例
json
{
"pitch": 1.498
}对应:
txt
较高音高常用值:
| 音 | pitch |
|---|---|
| C | 1.000 |
| D | 1.122 |
| E | 1.260 |
| F | 1.335 |
| G | 1.498 |
| A | 1.682 |
Instrument 示例
json
{
"instrument": "note.harp"
}常用乐器:
| 乐器 |
|---|
| note.harp |
| note.bass |
| note.pling |
| note.snare |
| note.hat |
Position 示例(暂未启用)
json
"default_position": [0, 64, 0]表示:
txt
世界坐标 x=0 y=64 z=0最小示例
json
{
"format": "mcmidi",
"version": 1,
"tps": 30,
"tracks": [
{
"id": "main",
"instrument": "note.harp"
}
],
"notes": [
{
"tick": 0,
"track": "main",
"pitch": 1.0
}
]
}