write_track_notes
Write or append structured note JSON to a named MIDI track, validating musician roles and replace/append modes while returning note counts and out-of-range warnings.
Instructions
向指定轨道写入或追加结构化音符 JSON(严禁直接写入二进制 MIDI)。
Args: project_id: 目标工程 ID。 track_name: 轨道名称(drums / bass / chords / melody)。 role: 提交音符的乐手角色(Drummer / Bassist / Synth)。 notes: 音符列表,每项包含 pitch、start_beat、duration_beats、velocity。 mode: 写入模式,"replace" 全量替换,"append" 追加到现有音符后。 program: 可选 General MIDI 音色编号(0-127);drums 轨道自动忽略。
Returns: 写入结果摘要、音符数量、拍数范围与越界警告。
Raises: ValueError: 当角色与轨道分工不匹配或音符字段不合法时抛出。 KeyError: 当 project_id 不存在时抛出。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"track_name": "<track_name>",
"role": "<role>",
"notes": "<notes>"
},
"name": "write_track_notes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | replace | |
| role | Yes | ||
| notes | Yes | ||
| program | No | ||
| project_id | Yes | ||
| track_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||