feat: 为 variance 参数添加绝对值编辑模式 - #9
Draft
KakaruHayate wants to merge 2 commits into
Draft
Conversation
基于上游 master (fadbfe9) 重放 PR #2 的 absolute variance 编辑模式,并修正已知问题: - absolute 轨直接采用用户声学目标;未编辑 NaN 帧跟随预测; - 移除 delta 逆函数绕行,修复 voicing 高目标不可达(predicted=-40, target=0 现正确输出 0dB); - mulaw voicing 仍按线上域解码→组合→编码回线上域; - 新增零依赖 VarianceAbsoluteTests,覆盖目标直用、NaN 跟随、声学范围钳位、与预测无关性; - docs 增加 §14.7 TuneLab 2.0 宿主要求:VoiceSynthesisSnapshotFactory / VoiceSynthesisContext / live evaluator 需消费 piecewise 轨。
- GetSynthesizedParameterConfigs 按当前 variance_param_mode 生成声明,absolute 模式不再声明已隐藏的 variance 回显轨。 - tension absolute 轨使用模型声学单位,不再错误标注为 dB。 验证:80/80 tests pass;插件 Release 构建 0 warning 0 error。
KakaruHayate
marked this pull request as draft
July 29, 2026 09:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
状态
功能
为 energy、breathiness、voicing、tension 增加 part 级
variance_param_mode:delta(默认,兼容现有工程):保留现有连续归一化偏移轨;absolute:改用分段绝对轨。energy / breathiness / voicing 使用[-96, 0] dB,tension 使用[-10, 10]模型声学单位;未编辑区为NaN,表示跟随 variance 模型预测。两种模式分别保存在 continuous / piecewise 容器中,切换模式不会覆盖另一侧数据。absolute 模式下编辑轨本身就是最终实参,因此不再重复暴露只读 variance 回显轨。
合成语义
absolute 轨表示最终声学目标:
NaN或无轨:跟随模型预测,并钳到同一声学范围;这保证目标值真正可达。例如 voicing 的
predicted=-40 dB, target=0 dB结果为0 dB,不会受 delta 模式1.25(即最多predicted + 12 dB)限制而停在-28 dB。对于
voicing_domain: mulaw,预测值先从模型线上域解码为 dB,完成组合后再编码回模型输入域;轨值和编辑语义仍保持 dB。主要改动
DiffSingerVarianceMath.CombineAbsoluteFrame作为零 SDK 依赖的单一数学实现;DeltaInverse/InvertVoicing数值求逆;验证
VarianceAbsoluteTests,覆盖:NaN跟随预测;TuneLab 宿主依赖
TuneLab
release/2.0.0(2c21ab9)已有 piecewise 轨的编辑、显示、序列化和段间NaN语义,但 voice synthesis 路径仍只从 continuousAutomations读取:VoiceSynthesisSnapshotFactory.cs需要按AutomationConfig.IsPiecewise从PiecewiseAutomations或Automations冻结正确 evaluator;piecewise 无数据时返回NaN,且不叠加 continuous automation vibrato。VoiceSynthesisContext.cs需要为PiecewiseAutomations建立 live evaluator,并接入现有项及ItemAdded/ItemRemoved/RangeModified失效通知。这些都是 TuneLab host-internal 改动,不需要修改冻结的
TuneLab.SDK/TuneLab.Foundation公共 ABI。完整依据和接线清单见docs/tunelab-voicebank-schema.md§14.7。