Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
--splash assets/splash/big.png \
--collect-data crepe \
--collect-data nicegui \
--collect-data swift_f0 \
--add-data "examples;examples/" \
--add-data "assets;assets/" \
--add-data "locales;locales/" \
Expand Down
43 changes: 25 additions & 18 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,31 @@ The current version supports importing the following expression parameters:
## ✅ Supported Platforms

* Windows / Linux
* OpenUtau Beta (supports DiffSinger)
* OpenUtau Beta (or other versions with DiffSinger support)
* Python 3.10 \*

If your system has an NVIDIA GPU driver that supports [CUDA 11.x](https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html) or later (i.e., driver version >= 450), this application will automatically enable GPU acceleration to improve processing speed.
By default, this application uses [swift-f0](https://github.com/lars76/swift-f0) (based on ONNX Runtime) as the pitch extraction backend, which runs on CPU only and satisfies basic usage scenarios.

<details>
<summary>Click to expand platform details</summary>
The classic [CREPE](https://github.com/marl/crepe) pitch extraction backend (depends on TensorFlow) is also available, which suits for scenarios with higher accuracy requirements. If your computer is equipped with an NVIDIA GPU and supports [CUDA 11.x](https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html) (i.e., GPU driver version >= 450), the CREPE backend will automatically enable GPU acceleration.

* \* This project uses [CREPE](https://github.com/marl/crepe) \*\* as the pitch extractor, which depends on TensorFlow. On Windows, TensorFlow 2.10 is the last version that supports GPU acceleration, and Python 3.10 is the highest Python version supported by its `.whl` files.
* \*\* In the future, it may switch to a PyTorch-based alternative like [PESTO](https://github.com/SonyCSLParis/pesto) to improve compatibility.

</details>
> \* On Windows, TensorFlow 2.10 is the last version that supports GPU acceleration, and Python 3.10 is the highest Python version supported by its `.whl` files.

## 📌 Use Case

**Typical Need:** When using a DiffSinger virtual singer for covers, users often already have the pitch track with lyrics, but lack suitable emotional expression. This tool is designed to automatically generate and import those expression parameters.
### Need

When using a DiffSinger virtual singer for covers, users often already have an OpenUtau project with lyrics and pitch track but without expression parameters. This tool extracts expression parameters from a reference vocal and imports them into the OpenUtau project.

**Required Inputs:**
### Inputs

* Virtual vocal: emotionless synthesized vocal output from OpenUtau (WAV format). It's recommended to keep `Tempo` and segmentation as close to the reference vocal as possible.
* Reference vocal: original human vocal recording (WAV format). You can use tools like [UVR](https://github.com/Anjok07/ultimatevocalremovergui) to remove instrumental and reverb.
* Input project: original OpenUtau project file (`.ustx` format).
* Output project path: where the new processed project will be saved.
* **Virtual vocal**: Emotionless synthesized vocal output from OpenUtau (WAV format). It's recommended to keep `Tempo` and segmentation as close to the reference vocal as possible.
* **Reference vocal**: Original human vocal recording (WAV format). You can use tools like [UVR](https://github.com/Anjok07/ultimatevocalremovergui) to remove instrumental and reverb.
* **Input project**: Original OpenUtau project file (USTX format).
* **Output path**: Where the new processed project file will be saved.

**Output:**
### Output

* A new `.ustx` file with emotion parameters added. The original project will not be modified.
A new USTX file with expression parameters added. The original project will not be modified.

## ✨ Features

Expand All @@ -73,8 +71,17 @@ If your system has an NVIDIA GPU driver that supports [CUDA 11.x](https://docs.n

You can download pre-compiled executable files directly from the [Releases](https://github.com/NewComer00/expressive/releases) page:

- `Expressive-GUI-<version>-Windows-x64-CPU.exe`: GUI installer for Windows x64, CPU-only (no CUDA dependencies)
- `Expressive-GUI-<version>-Windows-x64-GPU.exe`: GUI installer for Windows x64 with NVIDIA GPU acceleration (requires driver >= 450, CUDA 11.x)
### `Expressive-GUI-<version>-Windows-x64-CPU.exe`

GUI installer for Windows x64 architecture.

CPU-only, no CUDA runtime libraries included. Small installation size, but slower when using the CREPE backend for pitch extraction.

### `Expressive-GUI-<version>-Windows-x64-GPU.exe`

GUI installer for Windows x64 architecture with GPU support.

Includes CUDA runtime libraries. When used on a computer with an NVIDIA GPU (driver version >= 450), it significantly improves CREPE backend inference speed.

## 👨‍💻 Install from Source

Expand Down
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,31 @@
## ✅ 支持平台

* Windows / Linux
* OpenUtau Beta(支持 DiffSinger)
* OpenUtau Beta(或支持 DiffSinger 的其他版本
* Python 3.10 \*

若您的系统中安装了 NVIDIA 显卡驱动,且驱动支持 [CUDA 11.x](https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html)(即:驱动版本 >= 450),本应用会自动启用 GPU 加速以提升处理速度
本应用默认选择 [swift-f0](https://github.com/lars76/swift-f0)(基于 ONNX Runtime)作为音高提取后端,仅需 CPU 即可运行,可满足基础使用场景

也提供了经典的 [CREPE](https://github.com/marl/crepe)(依赖 TensorFlow)音高提取后端,适合更高要求的使用场景。若您的电脑配有 NVIDIA 显卡且支持 [CUDA 11.x](https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html)(即显卡驱动版本 >= 450),使用 CREPE 后端时会自动启用 GPU 加速。

<details>
<summary>点击展开更多平台说明</summary>

* \* 本项目使用 [CREPE](https://github.com/marl/crepe) \*\* 作为音高提取器,依赖于 TensorFlow 框架。在 Windows 平台下,TensorFlow 2.10 是最后一个支持 GPU 加速的版本,Python 3.10 是它的 `.whl` 文件支持的最高 Python 版本。
* \*\* 未来可能切换至基于 PyTorch 的 [PESTO](https://github.com/SonyCSLParis/pesto) 替代 CREPE,以提高兼容性。

</details>
> \* 在 Windows 平台下,TensorFlow 2.10 是最后一个支持 GPU 加速的版本,Python 3.10 是它的 `.whl` 文件支持的最高 Python 版本。

## 📌 使用场景

**典型需求**:在使用 DiffSinger 虚拟歌手翻唱时,已经完成了填好词的无参 OpenUtau 工程,但尚未添加表情参数。本应用可以从参考人声音频中提取表情参数,并导入至 OpenUtau 工程中。
### 需求

在使用 DiffSinger 虚拟歌手翻唱时,已经完成了填好词的无参 OpenUtau 工程,但尚未添加表情参数。本应用可以从参考人声音频中提取表情参数,并导入至 OpenUtau 工程中。

**所需输入:**
### 输入

* 歌姬音声:由 OpenUtau 输出的无表情虚拟歌声音频(WAV 格式)。建议节奏 (`Tempo`) 和分段尽量与参考人声一致。
* 参考人声:原始人声录音(WAV 格式),可使用 [UVR](https://github.com/Anjok07/ultimatevocalremovergui) 等工具去除伴奏与混响。
* 输入工程:原始 OpenUtau 工程文件(USTX 格式)。
* 输出工程路径:处理完成后新工程文件的保存位置。
* **歌姬音声**:由 OpenUtau 输出的无表情虚拟歌声音频(WAV 格式)。建议节奏 (`Tempo`) 和分段尽量与参考人声一致。
* **参考人声**:原始人声录音(WAV 格式),可使用 [UVR](https://github.com/Anjok07/ultimatevocalremovergui) 等工具去除伴奏与混响。
* **输入工程**:原始 OpenUtau 工程文件(USTX 格式)。
* **输出路径**:处理完成后新工程文件的保存位置。

**输出结果:**
### 输出

* 一个携带表情参数的新 USTX 文件原始工程不会被修改。
一个携带表情参数的新 USTX 文件原始工程不会被修改。

## ✨ 功能特性

Expand All @@ -74,8 +71,15 @@

您可以直接在 [Releases](https://github.com/NewComer00/expressive/releases) 页面下载预编译的可执行文件:

- `Expressive-GUI-<version>-Windows-x64-CPU.exe`: 适用于 x64 架构 Windows 的图形用户界面安装包(仅 CPU,无 CUDA 依赖)
- `Expressive-GUI-<version>-Windows-x64-GPU.exe`: 适用于 x64 架构 Windows 的图形用户界面安装包(含 NVIDIA GPU 加速,需驱动版本 >= 450,支持 CUDA 11.x)
### `Expressive-GUI-<version>-Windows-x64-CPU.exe`
适用于 x64 架构 Windows 的图形用户界面安装包。

仅可使用 CPU,无 CUDA 运行时库。安装体积小,但选择 CREPE 后端提取音高时速度较慢。

### `Expressive-GUI-<version>-Windows-x64-GPU.exe`
带 GPU 支持的适用于 x64 架构 Windows 的图形用户界面安装包。

含 CUDA 运行时库。在配备 NVIDIA 显卡(驱动版本 >= 450)的电脑上使用时,会大幅提高 CREPE 后端的推理速度。

## 👨‍💻 源码安装

Expand Down
6 changes: 5 additions & 1 deletion build/auto-py-to-exe.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
"optionDest": "collect_data",
"value": "nicegui"
},
{
"optionDest": "collect_data",
"value": "swift_f0"
},
{
"optionDest": "datas",
"value": "examples;examples/"
Expand Down Expand Up @@ -102,4 +106,4 @@
"increaseRecursionLimit": false,
"manualArguments": ""
}
}
}
9 changes: 5 additions & 4 deletions expressions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Args:
type: type
default: Any | None
help: str
choices: list | None = None


class ExpressionLoader():
Expand All @@ -24,10 +25,10 @@ class ExpressionLoader():
expression_info: str = ""
ustx_lock = threading.Lock()
args = SimpleNamespace(
ref_path = Args(name="ref_path" , type=str, default="", help=_l("Path to the reference audio file")),
utau_path = Args(name="utau_path" , type=str, default="", help=_l("Path to the UTAU audio file")),
ustx_path = Args(name="ustx_path" , type=str, default="", help=_l("Path to the USTX project file to be processed")), # noqa: E501
track_number = Args(name="track_number", type=int, default=1 , help=_l("Track number to apply expressions")),
ref_path = Args(name="ref_path" , type=str, default="", help=_l("Path to the **reference** audio file")), # noqa: E501
utau_path = Args(name="utau_path" , type=str, default="", help=_l("Path to the **UTAU** audio file")), # noqa: E501
ustx_path = Args(name="ustx_path" , type=str, default="", help=_l("Path to the `.ustx` project file to be processed")), # noqa: E501
track_number = Args(name="track_number", type=int, default=1 , help=_l("**Track number** to apply expressions to (1-based index)")), # noqa: E501
)

@classmethod
Expand Down
6 changes: 3 additions & 3 deletions expressions/dyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class DynLoader(ExpressionLoader):
expression_name = "dyn"
expression_info = _l("Dynamics (curve)")
args = SimpleNamespace(
align_radius = Args(name="align_radius", type=int , default=1 , help=_l("Radius for the FastDTW algorithm; larger radius allows for more flexible alignment but increases computation time")), # noqa: E501
smoothness = Args(name="smoothness" , type=int , default=2 , help=_l("Smoothness of the expression curve")),
scaler = Args(name="scaler" , type=float, default=1.5, help=_l("Scaling factor for the expression curve")), # noqa: E501
align_radius = Args(name="align_radius", type=int , default=1 , help=_l("**Radius** for the FastDTW alignment algorithm; larger values allow more flexible alignment but increase computation time")), # noqa: E501
smoothness = Args(name="smoothness" , type=int , default=2 , help=_l("Controls the **smoothness** of the expression curve using Gaussian filtering. Higher values produce smoother curves but may lose fine detail")), # noqa: E501
scaler = Args(name="scaler" , type=float, default=1.5, help=_l("**Scaling factor** applied to the expression curve. Values >1 amplify the expression, =1 keeps original intensity, <1 reduces it")), # noqa: E501
)

def get_expression(
Expand Down
Loading