Optimize Track Order
am_optimize_orderReorder tracks or playlist sections to avoid adjacent slow songs, small tempo shifts, and simultaneous tempo/key similarity, returning a suggested order without modifying Apple Music playlists.
Instructions
Optionally refine local audio transitions after the LLM has selected the songs and narrative blocks. By default it does not impose a global narrative arc or tempo curve; pass a named arc only when the user explicitly requests that preset. It returns an order without writing and must not choose songs or judge theme fit. / 中文:为一批曲目算出更好的顺序。这是本项目唯一会排序的工具——am_analyze_flow 只诊断(告诉你哪里有 2 处慢歌相邻、形状是 Icarus),不提供修法。这里用模拟退火处理四条相邻硬规则(不要两首慢歌相邻 / 不要「只慢一点」/ 相邻不该在 tempo 与 key 上同时相似 / 不要 BPM 无理由大跳、能量骤变)。默认不拟合全局叙事弧;只有显式传入 arc 才套用一个命名预设。只读:只返回建议顺序,不动任何歌单;把返回列表按原顺序交给 am_create_playlist 即可。因为需要每首的 BPM/调性,首次会联网抓特征(之后走缓存)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arc | No | 可选的全局叙事弧预设。省略时不强加叙事形状,只优化局部衔接;仅当用户明确要求某个命名曲线时才选择,例如 cinderella(起-落-起)。 | |
| isrcs | No | tracks/blocks 是否按 ISRC 精确匹配,默认 false | |
| blocks | No | 分组排序:每个子数组是一个乐章/段落,**段落之间的先后顺序保持不动**,只在段落内部重排。想保留叙事结构时用它(与 tracks 二选一) | |
| tracks | No | 要排序的曲目,每项 '歌名 - 艺人'(配 isrcs=true 时填 ISRC) | |
| refresh | No | 忽略音频特征缓存重抓,默认 false | |
| playlist | No | 要重排的现有歌单名或 p.xxxx ID(与 tracks/blocks 二选一) |