rvc developer on retainer: librosa.effects.pitch_shift(n_steps=12) in preprocessing AND f0_up_key=12 in RVC — double pitch shift 24 semitones up — male tenor 220 Hz plays back at 880 Hz — $162,000 — 6 months — rvc developer on monthly retainer
rvc-python 0.2.0 • librosa 0.10.1 • Python 3.10 • torch 2.0.1; librosa.effects.pitch_shift(n_steps=12) in preprocessing; f0_up_key=12 in RVCInference.infer(); both shift F0 additively; total: 24 semitones = 2 octaves; A3 (220 Hz) → A5 (880 Hz); fix: remove librosa preprocessing, keep f0_up_key=12 • Northfield RVC Vocals Ltd. (6-person AI karaoke platform; 6 months; 1.0h)
Northfield RVC Vocals Ltd. is a 6-person startup building an AI karaoke platform for indie musicians. Users upload a vocal recording of themselves singing a song; the platform converts their voice to sound like a licensed target artist voice (female mezzo-soprano, female pop soprano, male baritone). The developer wanted to implement male-to-female conversion, which requires shifting pitch up by approximately 12 semitones (one octave). Female voices typically have a fundamental frequency (F0) about one octave higher than male voices for the same sung note. The developer reasoned that the input audio needed to be “pre-shifted into the female range” before RVC processed it, and that f0_up_key was RVC’s “pitch targeting parameter” for the target voice. Both steps each added 12 semitones:
# convert.py — AI karaoke voice conversion (rvc-python 0.2.0, librosa 0.10.1)
import librosa, numpy as np, soundfile as sf
from rvc_python.infer import RVCInference
rvc = RVCInference(device="cuda:0")
rvc.load_model(
"models/emma/emma.pth",
index_path="models/emma/added_IVF1024_Flat_nprobe_7_emma_v2.index"
)
def convert_to_female_voice(input_path: str, output_path: str) -> None:
audio, sr = librosa.load(input_path, sr=44100, mono=True)
# Step 1: "Pre-shift input to female pitch range (1 octave up)"
audio = librosa.effects.pitch_shift(
audio,
sr=sr,
n_steps=12 # ← shifts F0 by +12 semitones (A3 220 Hz → A4 440 Hz)
)
sf.write("/tmp/presifted.wav", audio, sr)
# Step 2: RVC voice conversion — "target female pitch range"
rvc.infer(
input_path="/tmp/presifted.wav",
output_path=output_path,
f0_up_key=12, # ← shifts F0 by another +12 semitones (A4 440 Hz → A5 880 Hz)
f0_method="harvest",
index_rate=0.75,
protect=0.5,
resample_sr=0,
rms_mix_rate=0.25,
filter_radius=3
)
# Results on 1,200 test voice conversions (male tenor → target female voice):
# User complaint #1: "Output sounds like a chipmunk or cartoon, not a real voice"
# User complaint #2: "Way too high pitched — unusable for any song"
# User complaint #3: "Even at the highest note in the song it's already painful to listen to"
# Total unusable conversions: 1,200 of 1,200 (100%)
# Input F0 mean (male tenor A3 test track): 220 Hz
# Output F0 mean (after double shift): 882 Hz ← should be 440 Hz
# Semitone shift: 24 (12 from librosa + 12 from f0_up_key)
librosa.effects.pitch_shift() and RVC’s f0_up_key are two independent pitch shifting mechanisms that both operate on the fundamental frequency of the voice, and both operate on the signal path before the final output. librosa.effects.pitch_shift() resamples the waveform using a phase vocoder, shifting all frequencies (F0, harmonic overtones, and vocal formants) upward by exactly n_steps semitones. It outputs a modified waveform at the same sample rate. This modified waveform is then fed to RVC as the input signal. When RVC extracts F0 from this pre-shifted audio (using harvest or crepe), it measures the already-shifted F0. It then applies f0_up_key as an additional offset to the extracted F0 during voice synthesis. The two shifts are additive: total semitones = n_steps (librosa) + f0_up_key (RVC).
How 24 semitones pushes a male tenor voice above soprano range
# Pitch shift cascade for male tenor input (test track: A3 sustained note)
#
# Input F0: 220 Hz (A3 — male tenor mid-range)
#
# After librosa.effects.pitch_shift(n_steps=12):
# New F0: 220 × 2^(12/12) = 220 × 2.0 = 440 Hz (A4)
# This is in the female mezzo-soprano range ← CORRECT at this stage
#
# RVC f0_up_key=12 applied to 440 Hz extracted F0:
# New F0: 440 × 2^(12/12) = 440 × 2.0 = 880 Hz (A5)
# A5 is a full octave above concert A4 — well above soprano high notes
#
# Total shift: 12 + 12 = 24 semitones = 2^(24/12) = 4× frequency ratio
#
# Male tenor singing range → after 24 semitones:
# C3 (131 Hz) → C5 (524 Hz) ← upper soprano limit
# G3 (196 Hz) → G5 (784 Hz) ← above soprano range
# C4 (262 Hz) → C6 (1047 Hz) ← soprano whistle register boundary
# G4 (392 Hz) → G6 (1568 Hz) ← above human singing range
# B4 (494 Hz) → B6 (1976 Hz) ← above human singing range
#
# Soprano typical singing range: C4 (262 Hz) to E6 (1319 Hz)
# After 24 semitones: even the LOWEST male tenor note hits C5 (soprano upper range)
# After 24 semitones: upper tenor notes exceed human vocal range entirely
#
# Perceptual result:
# Sustained vowels: extremely high-pitched, thin, cartoon-like
# Consonant transitions: unnatural glides between pitches 2 octaves too high
# HuBERT content features: extracted from pre-shifted audio (not original voice)
# — formant structure also shifted, losing natural voice characteristics
# Speaker similarity to target female voice (cosine): 0.21 vs expected 0.78
# Naturalness MOS: 1.4
#
# Note: HuBERT (used for content feature extraction) is NOT pitch-invariant to
# 24-semitone shifts. At 12 semitones, content features are mostly preserved.
# At 24 semitones, the formant structure shifts enough to degrade content features.
Why six months of voice model switching and parameter tuning could not fix the double shift
The team received user complaints about extreme pitch and attributed the problem to the target voice models being incorrectly calibrated. They reasoned that switching to a voice model trained at a different pitch range would fix the output. Over six months they ran:
# Month 1: Switch target voice from "emma-soprano" to "lily-mezzo"
# librosa(n_steps=12) + f0_up_key=12 = 24 semitones ← unchanged
# Output F0: still 880 Hz on A3 input ← pitch shift is in the pipeline, not the model
# Conclusion: "mezzo voice just as high — both models have this problem"
#
# Month 2: Reduce f0_up_key from 12 to 6 (hypothesis: target was overshooting by half)
# librosa(n_steps=12) + f0_up_key=6 = 18 semitones
# A3 220 Hz → 220 × 2^(18/12) = 220 × 2.828 = 622 Hz (Eb5)
# Output: still too high, still sounds cartoon-pitched (18 semitones > female range for A3)
# Conclusion: "reduced but still wrong — target voice might need negative correction"
#
# Month 3: Try all three F0 extraction methods
# harvest: librosa(12) + f0_up_key=12 = 24 semitones, F0 882 Hz (unchanged)
# crepe: librosa(12) + f0_up_key=12 = 24 semitones, F0 879 Hz (unchanged)
# rmvpe: librosa(12) + f0_up_key=12 = 24 semitones, F0 884 Hz (unchanged)
# Conclusion: "F0 method makes no difference — a model quality issue"
#
# Month 4: Test male-to-male conversion as baseline (no pitch target)
# librosa(n_steps=12) + f0_up_key=0 = 12 semitones
# Output F0: 440 Hz — exactly 1 octave above input ← WORKS (this IS correct for female)
# Interpretation: "male voices don't need f0_up_key since they have no formant correction"
# Missed: this result shows ONE pitch shift (12 semitones) is correct; the problem is TWO
#
# Month 5: Adjust index_rate from 0.75 to 0.1
# librosa(n_steps=12) + f0_up_key=12 = 24 semitones ← unchanged
# Output: 24-semitone shift persists; timbre slightly more natural but pitch still wrong
# Conclusion: "reduced timbre artifact, pitch shift fundamental to target voice"
#
# Month 6: Request retainer engagement
# All 1,200 test conversions remain unusable: 100% too high pitched
#
# Retainer triage (1.0h):
# Step 1 (0.25h): Run convert_to_female_voice with f0_up_key=0, no librosa preprocessing
# → output F0 = 220 Hz (input pitch unchanged, voice timbre converted)
# Step 2 (0.25h): Run with f0_up_key=12, no librosa preprocessing
# → output F0 = 440 Hz (A4, female range) — sounds natural ✓
# Step 3 (0.25h): Check preprocessing pipeline → find librosa.effects.pitch_shift(n_steps=12)
# Step 4 (0.25h): Confirm: librosa shifts 220→440, f0_up_key shifts 440→880; additive
# Fix: remove librosa step; f0_up_key=12 alone achieves correct 440 Hz output
The retainer consultant identified the double pitch shift in 1.0 hour: 0.25h to run a baseline conversion (no librosa, f0_up_key=0) confirming the voice conversion pipeline was fundamentally working, then systematically test f0_up_key=12 alone without librosa and measure output F0 at 440 Hz (the correct target frequency for a 12-semitone male-to-female shift from A3); 0.25h to audit the full preprocessing pipeline and find the librosa.effects.pitch_shift(n_steps=12) call; 0.25h to explain why the month-4 male-to-male baseline test at f0_up_key=0 had produced correct output (12 semitones from librosa only was the right total amount) and why the developer had misinterpreted the result; 0.25h to remove the librosa preprocessing step, run 20 test conversions, verify output F0 at 435–445 Hz, and measure speaker similarity cosine 0.78 and MOS 4.0. Hours logged to HourTab with per-session breakdown.
# Fixed convert.py
import librosa, soundfile as sf
from rvc_python.infer import RVCInference
rvc = RVCInference(device="cuda:0")
rvc.load_model(
"models/emma/emma.pth",
index_path="models/emma/added_IVF1024_Flat_nprobe_7_emma_v2.index"
)
def convert_to_female_voice(input_path: str, output_path: str) -> None:
# Do NOT pitch-shift the input before RVC.
# f0_up_key handles the pitch transposition within the RVC voice conversion framework.
# Pre-shifting with librosa adds an extra 12 semitones on top of f0_up_key.
rvc.infer(
input_path=input_path, # ← original audio, not pre-shifted
output_path=output_path,
f0_up_key=12, # ← 12 semitones (1 octave) for male-to-female
f0_method="harvest",
index_rate=0.75,
protect=0.5,
resample_sr=0,
rms_mix_rate=0.25,
filter_radius=3
)
# Reference table: f0_up_key for common conversion targets
# Male tenor → female mezzo-soprano: f0_up_key=12 (1 octave up)
# Male baritone → female alto: f0_up_key=12 (1 octave up)
# Female soprano → male baritone: f0_up_key=-12 (1 octave down)
# Same gender, same register: f0_up_key=0 (timbre only)
# Male → child voice: f0_up_key=12 (1 octave up)
#
# After fix (20 test conversions, male tenor → emma mezzo-soprano):
# Input F0 mean: 220 Hz (A3)
# Output F0 mean: 441 Hz (≈ A4, female range) ← correct
# Speaker similarity cosine: 0.78 vs 0.21 pre-fix
# Naturalness MOS: 4.0 vs 1.4 pre-fix
# Usable conversions: 20/20 vs 0/1200 pre-fix
Related retainer posts
- so-vits-svc developer on retainer — SoftVC VITS SVC;
cluster_ratio=1.0blends 50% training speaker into converted voice; timbre instability; fix:cluster_ratio=0for content-only conversion; 1.5h - coqui-tts developer on retainer — Coqui TTS VITS; speaker embedding loaded from wrong speaker .npy file; output voice sounds like a blend of two speakers; fix: speaker_name from model metadata not filesystem alphabetical order; 2.0h
- tortoise-tts developer on retainer — TorToise TTS;
num_autoregressive_samplesset to 4 (fast) for final delivery; outputs at quality 2.1 MOS; fix:num_autoregressive_samples=256(high quality); 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 →