Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/release-notes/custom-resampler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Custom resamplers v0.4 + Auto pitch + Harmony generator

> **Vibe-coded with AI.** The Custom resamplers, Auto pitch and Harmony generator features in this build were written by [Claude](https://claude.com/claude-code) (Anthropic's AI, Claude Sonnet 5.5), directed by sparky-commits1637. The code has not been hand-reviewed or tested on a device yet, so please treat it as experimental.

Adds a **Custom resamplers** page to OpenUtau Mobile so you can use your own external resamplers.

### What's new
- **Options → Custom resamplers**: a new entry between *Plugin manager* and *Help & Tutorials*, styled like the rest of Options.
- **Add** a resampler with the **+** button. Its matching `.yaml` manifest (same name) is copied along with it.
- **Replace** an existing one by adding a file with the same name, or **remove** one with the trash button.
- Added resamplers show up in **Track render settings → Resampler**.
- Translations: English, 简体中文, 日本語, Русский, Українська.

### Good to know
- Resamplers are external programs that run on your device. Only add files you trust. The app asks you to confirm.
- Supported files on Android: `.sh` scripts or extensionless native binaries built for Android. `.exe` / `.bat` only load if a Wine path is set in Settings. The page shows what your device accepts.
- Being listed does not guarantee a program runs on your device.
- Close the open project before adding or removing a resampler.
- Names used by built-in resamplers (`worldline`, `hifisampler`) are not allowed.
- Not offered on iOS or in the browser.

### What's new in v0.4
- **Auto pitch** (Batch edit → Notes): generates a pitch curve from note data with an ONNX model, ported from [UtauV](https://github.com/emeraldsingers/UtauV). The model is **not included**. Download `autopitchcurve` (`.oudep`) from the [UtauV_Packages](https://github.com/emeraldsingers/UtauV_Packages) releases and install it via **Dependency manager → Install from file**. Select a whole phrase first. It runs on the CPU, so expect it to be slow on a phone.
- **Harmony generator** (Batch edit → Notes): adds harmony tracks for the current track (Pop style, automatic key, 1–8 voices), also ported from UtauV.
- **Signed with a fixed key**: this and later builds from this workflow are signed with the same key, so updates install over each other. **Uninstalling the previous copy is needed once**, because the key changed.
- Neither feature has been tested on a device.

### What was new in v0.3
- The app now **targets Android API 28**. On Android 10+, apps targeting API 29 or higher are blocked by SELinux from executing files in their own data folder, so starting a custom resampler failed with **"Permission denied"**. With API 28 that block no longer applies (Termux works the same way). This is the only code change since v0.2.
- **Not fixed / not confirmed:** some native resamplers still crash with **exit code 159 (SIGSYS)**, where Android's seccomp filter kills a process that uses a blocked system call. v0.3 does not address that, and a full render has not been confirmed to finish inside the app.
- Targeting API 28 changes some Android behaviors (for example storage and network defaults). Nothing has been tested on a device for those either.

### About this build
- Installs as a **separate app** named *OpenUtau Mobile (Custom Resampler)* (package `pers.vocoder712.openutaumobile.canary.resampler`), so it can sit next to the official build. It has its own settings, singers and plugins. Projects saved in shared folders can be opened from either app.
- **Updating from v0.3 or earlier:** those builds used a random debug key, so Android will refuse to install this over them. Uninstall that copy first, which erases its app data (imported voicebanks, projects), so back them up before you do. From this version on, builds share one key and update in place.
- Android **ARM64** only, **signed with a fixed (self-generated) key**.
- Built from upstream `dev` plus the custom resampler, Auto pitch and Harmony generator features. It compiles, but has not been tested on a device yet.
- Please report problems with the log from **Options → Export Log**.
117 changes: 117 additions & 0 deletions .github/workflows/build-apk-artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build APK Artifact

on:
push:
branches:
- feature/custom-resampler-manager

permissions:
contents: write

jobs:
android-build:
name: Build Android ARM64 APK
env:
AVALONIA_TELEMETRY_OPTOUT: "1"
Configuration: Release
RuntimeIdentifier: android-arm64
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Setup Android SDK command-line tools
uses: android-actions/setup-android@v3
with:
packages: 'platform-tools platforms;android-36 build-tools;36.0.0'
log-accepted-android-sdk-licenses: false

- name: Install Android workload
run: dotnet workload install android

- name: Setup native Bazel build tools
uses: ./.github/actions/setup-worldline

- name: Install Android native toolchain
shell: bash
run: |
set -euo pipefail
sdkmanager "ndk;$(tr -d '\r\n' < native/android-ndk-version.txt)"

- name: Give the build its own app name (CI only, repo files stay unchanged)
run: |
sed -i 's|<string name="app_name">.*</string>|<string name="app_name">OpenUtau Mobile (Custom Resampler)</string>|' OpenUtauMobile.Android/Resources/values/strings.xml
grep -n app_name OpenUtauMobile.Android/Resources/values/strings.xml

- name: Prepare signing key
id: signing
env:
KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
run: |
# With the repo secrets set, every build is signed with the same key, so new APKs
# install over older ones (no uninstall, no data loss). Without them the build falls
# back to a random debug key, like before.
if [ -n "$KEYSTORE_B64" ]; then
echo "$KEYSTORE_B64" | base64 -d > "$RUNNER_TEMP/release.keystore"
echo "enabled=true" >> "$GITHUB_OUTPUT"
echo "Using the fixed signing key."
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
echo "::warning::ANDROID_KEYSTORE_BASE64 is not set - falling back to a random debug key (updates will need an uninstall)."
fi

- name: Build Android ARM64
env:
KS_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
KS_FILE: ${{ runner.temp }}/release.keystore
run: |
SIGN=()
if [ "${{ steps.signing.outputs.enabled }}" = "true" ]; then
SIGN=(-p:AndroidKeyStore=true "-p:AndroidSigningKeyStore=$KS_FILE" -p:AndroidSigningKeyAlias=openutau
-p:AndroidSigningStorePass=env:KS_PASS -p:AndroidSigningKeyPass=env:KS_PASS)
fi
dotnet build OpenUtauMobile.Android/OpenUtauMobile.Android.csproj -p:ApplicationId=pers.vocoder712.openutaumobile.canary.resampler "${SIGN[@]}"

- name: Remove signing key from the runner
if: always()
run: rm -f "$RUNNER_TEMP/release.keystore"

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: OpenUtauMobile-android-arm64-debug
path: OpenUtauMobile.Android/bin/Release/**/*.apk
if-no-files-found: error

- name: Publish GitHub release
if: contains(github.event.head_commit.message, '[release]')
env:
GH_TOKEN: ${{ github.token }}
TAG: custom-resampler-v0.4
run: |
set -euo pipefail
apk=$(find OpenUtauMobile.Android/bin/Release -name '*-Signed.apk' | head -n1)
if [ -z "$apk" ]; then apk=$(find OpenUtauMobile.Android/bin/Release -name '*.apk' | head -n1); fi
test -n "$apk"
cp "$apk" OpenUtauMobile-custom-resampler-v0.4-android-arm64.apk
gh release create "$TAG" OpenUtauMobile-custom-resampler-v0.4-android-arm64.apk \
--repo "$GITHUB_REPOSITORY" \
--target "$GITHUB_SHA" \
--title "Custom resamplers v0.4 + Auto pitch + Harmony generator" \
--notes-file .github/release-notes/custom-resampler.md \
--prerelease
Loading