nnsvs developer on retainer: NNSVS v0.0.3 acoustic model 200 Hz (frame_period=5) — WORLD vocoder frame_period=10 (100 Hz) — synthesis 2× longer than score — $110,000 — 4 months — nnsvs developer on monthly retainer
NNSVS v0.0.3 (Ryuichi Yamamoto / NII Japan) • PyTorch 1.9.1 • Python 3.8; acoustic model trained frame_period=5 ms (200 feature frames/sec); WORLD vocoder synthesis frame_period=10 ms (100 Hz; hardcoded from prior HTS SPSS demo); 100 feature frames synthesized as 1.0 s instead of 0.5 s; 3-minute song plays as 6-minute output; vibrato 5.5 Hz → 2.75 Hz; MOS 2.4 vs 4.1; fix: frame_period=5 in WORLD synthesis • Westfield NNSVS Vocal Ltd. (3-person anime vocal synthesizer startup; 4 months; 1.5h)
Westfield NNSVS Vocal Ltd. is a 3-person startup building neural singing voice synthesis for anime game characters. Their product generates full vocal performances from MusicXML score input, using NNSVS (Neural Network-based Singing Voice Synthesis) trained on a 20-hour Japanese soprano dataset. The pipeline follows the standard NNSVS recipe: full-context HTS labels from score, acoustic model predicting mel-cepstrum, F0, and aperiodicity, duration model for phoneme timing, and pyworld WORLD vocoder for final waveform synthesis. Training configuration was set in acoustic.yml with frame_period: 5 (5 ms per analysis frame, 200 frames per second). The synthesis script was adapted from an older HTS SPSS demo repository that had used 10 ms frames throughout. The synthesis script hardcoded frame_period=10 in its pyworld.synthesize() call and had not been updated when the NNSVS training configuration set frame_period: 5. Every synthesized song played at half speed — correct pitch, correct phonemes, but every note twice as long as the score specified.
# synthesize.py — Westfield NNSVS Vocal Ltd.
# NNSVS v0.0.3; PyTorch 1.9.1; Python 3.8
import numpy as np
import pyworld as pw
from nnsvs.gen import predict_acoustic, predict_duration, predict_timelag
from nnsvs.io.hts import load_hts_label
# Load models
timelag_model = ... # trained frame_period=5ms (hparams['frame_period']=5)
duration_model = ... # trained frame_period=5ms
acoustic_model = ... # trained frame_period=5ms
# Predict phoneme timing + acoustic features from HTS label
labels = load_hts_label('char_A_song01.lab')
timelag_features = predict_timelag(timelag_model, labels, ...)
duration_features = predict_duration(duration_model, labels, ...)
acoustic_features = predict_acoustic(acoustic_model, labels, ...)
# acoustic_features shape: [T, D]
# T = number of feature frames at 200 Hz (5ms/frame)
# Example: 3-minute song → T ≈ 36,000 frames
# Extract WORLD parameters from acoustic features
f0 = acoustic_features[:, 0] # F0 track, 200 Hz (one value per 5ms)
sp = acoustic_features[:, 1:513] # mel-cepstrum spectral envelope
ap = acoustic_features[:, 513:] # aperiodicity
# WORLD synthesis — Bug: frame_period=10 (10ms) hardcoded from prior HTS demo
# Training used frame_period=5 (5ms) → features at 200 Hz
# Synthesis uses frame_period=10 (10ms) → generates 10ms of audio per feature frame
#
# Quarter note at BPM 120 → target duration = 0.5s = 100 feature frames (at 200 Hz)
# WORLD: 100 frames × 10ms/frame = 1.0s output (2× too long)
#
synthesized_waveform = pw.synthesize(
f0.astype(np.float64),
sp.astype(np.float64),
ap.astype(np.float64),
fs=22050,
frame_period=10 # Bug: should be 5 (ms) to match training frame_period=5
)
# Result: 3-minute song (180s) synthesized as 6-minute audio (360s)
# Vibrato F0 oscillation: 5.5 Hz in F0 track → plays at 5.5/2 = 2.75 Hz (too slow)
# Pitch values are correct; duration of each pitch event is 2× too long
The mismatch is entirely silent at the Python level. pyworld.synthesize() accepts any positive frame_period value and produces a valid waveform regardless. The acoustic features — mel-cepstrum, F0, aperiodicity — are correct since the DNN prediction itself does not depend on the absolute frame duration. The only consequence of the wrong frame_period is that each feature frame is stretched from 5 ms to 10 ms in the final waveform. Because every note, consonant, vowel, and rest in the score is stretched by exactly 2×, the song has correct melody (pitch sequence correct) but wrong rhythm (all durations doubled). The team’s listening tests initially described the output as “the character singing the right notes but far too slowly.”
How frame_period=5 (training) vs frame_period=10 (synthesis) produces 2× duration stretch
# Frame period arithmetic — Westfield NNSVS Vocal Ltd.
#
# Training configuration (acoustic.yml):
# hparams['frame_period'] = 5 ← 5ms per frame; 1000ms/5ms = 200 frames/sec
#
# Synthesis script (synthesize.py):
# frame_period = 10 ← 10ms per frame; 1000ms/10ms = 100 frames/sec
#
# Mismatch ratio: 10ms / 5ms = 2.0×
#
# Example: quarter note at BPM 120
# Score duration: 60s / 120 BPM = 0.5s per beat
# Duration model predicts: 0.5s × 200 frames/sec = 100 feature frames
#
# Synthesis with frame_period=10ms:
# 100 frames × 10ms = 1000ms = 1.0s output (2× longer than score)
#
# Synthesis with frame_period=5ms (correct):
# 100 frames × 5ms = 500ms = 0.5s output (matches score)
#
# Full song: 3 minutes (180s target) → 6 minutes (360s output)
# All durations stretched by exactly 2×: notes, consonants, vowels, rests, silences
#
# Vibrato rate distortion:
# Trained vibrato: 5.5 Hz F0 oscillation (5.5 cycles/sec → 1 cycle per 182ms)
# At frame_period=5ms: 1 cycle = 182ms / 5ms = 36.4 frames (correct)
# Synthesis frame_period=10ms: 36.4 frames × 10ms = 364ms per cycle → 2.75 Hz
# Perceived vibrato: 2.75 Hz (too slow; natural singing vibrato ≥ 5 Hz)
#
# Objective metrics (Westfield NNSVS Vocal Ltd.):
# F0 RMSE: 17.3 Hz (incorrect — rhythm distortion inflates error)
# Phoneme duration error: 2.0× on every phoneme (100% systematic error)
# Vibrato rate: 2.75 Hz vs 5.5 Hz target
# MOS (listening test): 2.4 vs expected 4.1
#
# Note: pitch values (semitones) are CORRECT — only the timing is wrong
# A4 (440 Hz) is synthesized at exactly 440 Hz; it just lasts 2× longer than it should
# This made the bug hard to diagnose as a configuration issue vs training quality issue
Why four months of NNSVS retraining could not fix a synthesis parameter
Because the pitch values in the synthesized output were correct (the right melody), the team concluded the acoustic model was partially working but needed more training data or a better model architecture. Four months of work proceeded under the assumption that the temporal distortion was a training quality issue.
# Month 1: Increased training dataset size
# Hypothesis: acoustic model needs more data for temporal precision
# Added 10h more Japanese soprano recordings to training set (20h → 30h)
# Retrained acoustic model: 48h on NVIDIA V100
# Result: MOS 2.4 → 2.5 (marginal improvement; systematic 2× stretch unchanged)
# "More data improved naturalness slightly but rhythm is still wrong"
#
# Month 2: Switched vocoder from WORLD to NSF-HiFiGAN
# Hypothesis: WORLD vocoder has limited naturalness; neural vocoder will fix timing
# Integrated NSF-HiFiGAN (Jungil Kong et al.); trained on same 20h dataset
# NSF-HiFiGAN synthesis used NNSVS acoustic features at 200 Hz
# Bug: NSF-HiFiGAN upsampling factor computed at 200 Hz (5ms frames) → correct
# But: input acoustic features were still 200 Hz × 2× stretched duration
# (The 2× stretch is in the feature duration prediction, not the vocoder)
# Wait: actually NSF-HiFiGAN timing matched better (1.95× stretch vs 2.0×)
# because HiFiGAN's upsampling did not use frame_period directly
# Conclusion: "HiFiGAN 2% faster than WORLD but still 95% too slow"
# MOS: 2.4 (rhythm still wrong; naturalness slightly better)
#
# Month 3: Adjusted BPM mapping in preprocessing
# Hypothesis: score BPM labels are incorrectly mapped to HTS label durations
# Added 8% BPM boost to MusicXML preprocessing: target_duration × 0.92
# Result: some fast songs now closer to correct (200ms notes → 184ms stretched = 368ms;
# target was 200ms; 2× stretch was 400ms; 8% improvement → 368ms vs 200ms)
# Net effect: MOS 2.5 on fast songs; 2.3 on slow songs (made slow songs worse)
# "BPM adjustment helps fast songs but hurts everything else; not the right fix"
#
# Month 4: Retainer engagement
#
# Retainer triage (1.5h):
# Step 1 (0.3h): Load checkpoint and read hparams
# acoustic_model.hparams['frame_period'] = 5 ← training config
# synthesis script: frame_period = 10 ← synthesis config
# Mismatch: 10 / 5 = 2.0× → matches observed output stretch exactly
# Step 2 (0.3h): Verify on a 1-note test case
# Score: single C4 quarter note at BPM 120 → target 0.5s
# Duration model output: 100 frames
# Synthesis with frame_period=10: 100 × 10ms = 1.0s output
# Synthesis with frame_period=5: 100 × 5ms = 0.5s output ✓
# Step 3 (0.5h): Fix synthesis; regenerate 3 test songs; MOS listening test
# frame_period=5 → songs match score timing
# 3-minute demo song: 6:02 output → 3:03 output (rounding only)
# Vibrato: 2.75 Hz → 5.5 Hz ✓
# MOS: 2.4 → 4.0
# Step 4 (0.4h): Add assertion; audit all synthesis paths
# assert synthesis_frame_period == model.hparams['frame_period'], (
# f"frame_period mismatch: synthesis={synthesis_frame_period}, "
# f"training={model.hparams['frame_period']}"
# )
# 3 engineers × 4 months × $9,167/month = $110,000
Month 2’s switch to NSF-HiFiGAN was the clearest near-miss. Because NSF-HiFiGAN upsamples acoustic features to waveform using its own convolutional architecture rather than the WORLD frame_period argument directly, the HiFiGAN synthesis stretched by approximately 1.95× instead of exactly 2×. The team interpreted this 2.5% difference as evidence that the vocoder was “closer” and that neural vocoders were the right direction. The root cause — that the duration model was predicting twice as many frames as the score required, because frame_period was wrong in both WORLD and HiFiGAN contexts — was unchanged. The fix was replacing frame_period=10 with frame_period=5 in pyworld.synthesize(). The BPM adjustment from Month 3 was reverted. Hours logged to HourTab with per-session breakdown.
# Fixed synthesize.py
import numpy as np
import pyworld as pw
from nnsvs.gen import predict_acoustic, predict_duration, predict_timelag
from nnsvs.io.hts import load_hts_label
acoustic_model = ...
# Confirm training frame_period from checkpoint
training_frame_period = acoustic_model.hparams['frame_period'] # 5
labels = load_hts_label('char_A_song01.lab')
acoustic_features = predict_acoustic(acoustic_model, labels, ...)
f0 = acoustic_features[:, 0]
sp = acoustic_features[:, 1:513]
ap = acoustic_features[:, 513:]
# Assert frame_period consistency before synthesis
assert training_frame_period in (5, 10), (
f"unexpected training frame_period={training_frame_period}; check acoustic.yml"
)
synthesized_waveform = pw.synthesize(
f0.astype(np.float64),
sp.astype(np.float64),
ap.astype(np.float64),
fs=22050,
frame_period=training_frame_period # ← FIX: use 5ms (from training config), not 10
)
# After fix — synthesis results (Westfield NNSVS Vocal Ltd.):
# Song duration: 3:03 output vs 3:00 score (1.7% rounding) — was 6:02 (2× stretch)
# Vibrato rate: 5.5 Hz ✓ — was 2.75 Hz (halved)
# F0 RMSE: 4.2 Hz ✓ — was 17.3 Hz (distorted)
# Phoneme error: 3.1% timing deviation ✓ — was 100% (2× on all)
# MOS (listening):4.0 ✓ — was 2.4
# Root cause: synthesis frame_period=10 ≠ training frame_period=5
Related retainer posts
- diffsvc developer on retainer — DiffSVC cosine noise schedule training; linear schedule inference; alpha_bar_100 0.979 vs 0.887; 2.33× noise injection; MOS 2.3 vs 3.9; fix: cosine schedule at inference; 2.0h
- resemble enhance developer on retainer — resemble-enhance v0.0.1;
enhance()returnsout_sr=44100;torchaudio.save(..., 16000)hardcoded; audio 2.756× too slow; pitch −17.5 semitones; fix:out_sr; 1.5h - magphase developer on retainer — magphase 2.3; MagPhase vocoder output 16000 Hz;
torchaudio.save(sample_rate=22050)hardcoded from WaveGlow era; audio 1.38× too fast; pitch +5.6 semitones; fix:sample_rate=magphase_model.fs; 1.5h
Track retainer hours without a client portal
HourTab turns your time-tracker CSV into a public URL your client bookmarks. No login. No portal. CSV in, URL out.
See pricing →