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
+
import numpy as np
|
| 6 |
+
from pydub import AudioSegment
|
| 7 |
+
from pedalboard import Pedalboard, Compressor, Reverb, Delay, NoiseGate, Chorus
|
| 8 |
+
from pedalboard.io import AudioFile
|
| 9 |
+
from separator.audio_writer import write_audio_file
|
| 10 |
+
import tempfile
|
| 11 |
+
from model_list import models_data as mvsepless_models
|
| 12 |
+
from multi_inference import single_multi_inference
|
| 13 |
+
|
| 14 |
+
RVC_MODELS_DIR = os.path.join(os.getcwd(), "voice_models")
|
| 15 |
+
OUTPUT_FORMAT = ["mp3", "wav", "flac", "aiff", "m4a", "aac", "ogg", "opus"]
|
| 16 |
+
|
| 17 |
+
# Глобальная переменная для хранения промежуточных файлов
|
| 18 |
+
saved_processing_data = None
|
| 19 |
+
|
| 20 |
+
# Словари переводов
|
| 21 |
+
TRANSLATIONS = {
|
| 22 |
+
"ru": {
|
| 23 |
+
# Общие элементы
|
| 24 |
+
"model_name_label": "Имя модели",
|
| 25 |
+
"update_button": "Обновить",
|
| 26 |
+
"input_audio_label": "Входная песня",
|
| 27 |
+
"generate_btn": "Сгенерировать кавер",
|
| 28 |
+
"remix_btn": "Пересвести кавер",
|
| 29 |
+
"final_result": "Финальный результат",
|
| 30 |
+
"intermediate_files": "Промежуточные файлы",
|
| 31 |
+
"status_label": "Статус",
|
| 32 |
+
"tab_separation": "Разделение",
|
| 33 |
+
"tab_voice_settings": "Настройки преобразования голоса",
|
| 34 |
+
"tab_mixing_settings": "Настройки сведения аудио",
|
| 35 |
+
|
| 36 |
+
# Разделение
|
| 37 |
+
"preclear_vocals": "Очистить вокал от реверба/эха",
|
| 38 |
+
"split_vocals": "Разделить вокал на лид/бэк-вокалы",
|
| 39 |
+
"vocal_model": "Вокальная модель",
|
| 40 |
+
"dereverb_model": "Dereverb/Deecho модель",
|
| 41 |
+
"karaoke_model": "Караоке модель",
|
| 42 |
+
|
| 43 |
+
# Преобразование голоса
|
| 44 |
+
"conversion_mode": "Режим преобразования",
|
| 45 |
+
"conversion_info": "lead - только основной вокал\nback - только бэк-вокал\nlead/back - основной и бэк-вокалы\nfull - весь вокал",
|
| 46 |
+
"vocal_pitch": "Высота тона вокала",
|
| 47 |
+
"backing_pitch": "Высота тона бэк-вокала",
|
| 48 |
+
"pitch_method": "Метод извлечения тона",
|
| 49 |
+
"max_pitch": "Верхний лимит определения высоты тона",
|
| 50 |
+
"index_rate": "Влияние индекса",
|
| 51 |
+
"filter_radius": "Радиус фильтра",
|
| 52 |
+
"rms_envelope": "Огибающая громкости",
|
| 53 |
+
"protect_cons": "Защита согласных",
|
| 54 |
+
"hop_length": "Длина шага",
|
| 55 |
+
|
| 56 |
+
# Сведение
|
| 57 |
+
"volume_adjust": "Изменение громкости",
|
| 58 |
+
"vocals_gain": "Вокал",
|
| 59 |
+
"backing_gain": "Бэк-вокал",
|
| 60 |
+
"inst_gain": "Инструментал",
|
| 61 |
+
"output_format": "Формат вывода",
|
| 62 |
+
"add_unconv": "Добавить к инструменталу непреобразованный вокал",
|
| 63 |
+
"add_effects": "Добавить эффекты на голос",
|
| 64 |
+
|
| 65 |
+
# Эффекты
|
| 66 |
+
"effects_tab": "Эффекты",
|
| 67 |
+
"echo_tab": "Эхо",
|
| 68 |
+
"echo_delay": "Время задержки (сек)",
|
| 69 |
+
"echo_feedback": "Обратная связь",
|
| 70 |
+
"echo_mix": "Смешение",
|
| 71 |
+
"reverb_tab": "Реверберация",
|
| 72 |
+
"reverb_size": "Размер комнаты",
|
| 73 |
+
"reverb_width": "Ширина реверберации",
|
| 74 |
+
"reverb_wet": "Уровень влажности",
|
| 75 |
+
"reverb_dry": "Уровень сухости",
|
| 76 |
+
"reverb_damping": "Уровень демпфирования",
|
| 77 |
+
"chorus_tab": "Хорус",
|
| 78 |
+
"chorus_rate": "Скорость хоруса",
|
| 79 |
+
"chorus_depth": "Глубина хоруса",
|
| 80 |
+
"chorus_delay": "Задержка центра (мс)",
|
| 81 |
+
"chorus_feedback": "Обратная связь",
|
| 82 |
+
"chorus_mix": "Смешение",
|
| 83 |
+
|
| 84 |
+
# Обработка
|
| 85 |
+
"processing_tab": "Обработка",
|
| 86 |
+
"compressor_tab": "Компрессор",
|
| 87 |
+
"comp_ratio": "Соотношение",
|
| 88 |
+
"comp_threshold": "Порог",
|
| 89 |
+
"comp_attack": "Время атаки (мс)",
|
| 90 |
+
"comp_release": "Время спада (мс)",
|
| 91 |
+
"noise_gate_tab": "Подавление шума",
|
| 92 |
+
"gate_threshold": "Порог",
|
| 93 |
+
"gate_ratio": "Соотношение",
|
| 94 |
+
"gate_attack": "Время атаки (мс)",
|
| 95 |
+
"gate_release": "Время спада (мс)",
|
| 96 |
+
|
| 97 |
+
# Статусы
|
| 98 |
+
"start_processing": "Начало обработки...",
|
| 99 |
+
"separation": "Разделение на музыку и вокал...",
|
| 100 |
+
"extracting": "Извлечение лид/бэк-вокала...",
|
| 101 |
+
"cleaning": "Очистка вокалов...",
|
| 102 |
+
"converting": "Преобразование вокалов...",
|
| 103 |
+
"mixing": "Сведение итогового кавера...",
|
| 104 |
+
|
| 105 |
+
# Ошибки
|
| 106 |
+
"error_audio_model": "Сначала загрузите аудио и выберите модель",
|
| 107 |
+
"error_audio": "Сначала загрузите аудио",
|
| 108 |
+
"error_model": "Сначала выберите модель",
|
| 109 |
+
"error_generate_first": "Сначала сгенерируйте кавер хотя бы один раз!",
|
| 110 |
+
|
| 111 |
+
"vbach_required": "Vbach (RVC) не установлен. В блокноте запустите ячейку 'Установка' с флагом install_vbach [✓]"
|
| 112 |
+
},
|
| 113 |
+
"en": {
|
| 114 |
+
# General elements
|
| 115 |
+
"model_name_label": "Model name",
|
| 116 |
+
"update_button": "Update",
|
| 117 |
+
"input_audio_label": "Input song",
|
| 118 |
+
"generate_btn": "Generate cover",
|
| 119 |
+
"remix_btn": "Remix cover",
|
| 120 |
+
"final_result": "Final result",
|
| 121 |
+
"intermediate_files": "Intermediate files",
|
| 122 |
+
"status_label": "Status",
|
| 123 |
+
"tab_separation": "Separation",
|
| 124 |
+
"tab_voice_settings": "Voice conversion settings",
|
| 125 |
+
"tab_mixing_settings": "Audio mixing settings",
|
| 126 |
+
|
| 127 |
+
# Separation
|
| 128 |
+
"preclear_vocals": "Clear vocals from reverb/echo",
|
| 129 |
+
"split_vocals": "Split vocals into lead/backing",
|
| 130 |
+
"vocal_model": "Vocal model",
|
| 131 |
+
"dereverb_model": "Dereverb/Deecho model",
|
| 132 |
+
"karaoke_model": "Karaoke model",
|
| 133 |
+
|
| 134 |
+
# Voice conversion
|
| 135 |
+
"conversion_mode": "Conversion mode",
|
| 136 |
+
"conversion_info": "lead - lead vocals only\nback - backing vocals only\nlead/back - both vocals\nfull - full vocals",
|
| 137 |
+
"vocal_pitch": "Vocal pitch",
|
| 138 |
+
"backing_pitch": "Backing vocals pitch",
|
| 139 |
+
"pitch_method": "Pitch extraction method",
|
| 140 |
+
"max_pitch": "Max pitch detection frequency",
|
| 141 |
+
"index_rate": "Index rate",
|
| 142 |
+
"filter_radius": "Filter radius",
|
| 143 |
+
"rms_envelope": "RMS envelope",
|
| 144 |
+
"protect_cons": "Protect consonants",
|
| 145 |
+
"hop_length": "Hop length",
|
| 146 |
+
|
| 147 |
+
# Mixing
|
| 148 |
+
"volume_adjust": "Volume adjustment",
|
| 149 |
+
"vocals_gain": "Vocals",
|
| 150 |
+
"backing_gain": "Backing vocals",
|
| 151 |
+
"inst_gain": "Instrumental",
|
| 152 |
+
"output_format": "Output format",
|
| 153 |
+
"add_unconv": "Add unconverted vocals to instrumental",
|
| 154 |
+
"add_effects": "Apply effects to vocals",
|
| 155 |
+
|
| 156 |
+
# Effects
|
| 157 |
+
"effects_tab": "Effects",
|
| 158 |
+
"echo_tab": "Echo",
|
| 159 |
+
"echo_delay": "Delay time (sec)",
|
| 160 |
+
"echo_feedback": "Feedback",
|
| 161 |
+
"echo_mix": "Mix",
|
| 162 |
+
"reverb_tab": "Reverb",
|
| 163 |
+
"reverb_size": "Room size",
|
| 164 |
+
"reverb_width": "Reverb width",
|
| 165 |
+
"reverb_wet": "Wet level",
|
| 166 |
+
"reverb_dry": "Dry level",
|
| 167 |
+
"reverb_damping": "Damping",
|
| 168 |
+
"chorus_tab": "Chorus",
|
| 169 |
+
"chorus_rate": "Rate (Hz)",
|
| 170 |
+
"chorus_depth": "Depth",
|
| 171 |
+
"chorus_delay": "Center delay (ms)",
|
| 172 |
+
"chorus_feedback": "Feedback",
|
| 173 |
+
"chorus_mix": "Mix",
|
| 174 |
+
|
| 175 |
+
# Processing
|
| 176 |
+
"processing_tab": "Processing",
|
| 177 |
+
"compressor_tab": "Compressor",
|
| 178 |
+
"comp_ratio": "Ratio",
|
| 179 |
+
"comp_threshold": "Threshold (dB)",
|
| 180 |
+
"comp_attack": "Attack time (ms)",
|
| 181 |
+
"comp_release": "Release time (ms)",
|
| 182 |
+
"noise_gate_tab": "Noise Gate",
|
| 183 |
+
"gate_threshold": "Threshold (dB)",
|
| 184 |
+
"gate_ratio": "Ratio",
|
| 185 |
+
"gate_attack": "Attack time (ms)",
|
| 186 |
+
"gate_release": "Release time (ms)",
|
| 187 |
+
|
| 188 |
+
# Statuses
|
| 189 |
+
"start_processing": "Starting processing...",
|
| 190 |
+
"separation": "Separating music and vocals...",
|
| 191 |
+
"extracting": "Extracting lead/backing vocals...",
|
| 192 |
+
"cleaning": "Cleaning vocals...",
|
| 193 |
+
"converting": "Converting vocals...",
|
| 194 |
+
"mixing": "Mixing final cover...",
|
| 195 |
+
|
| 196 |
+
# Errors
|
| 197 |
+
"error_audio_model": "Please upload audio and select model first",
|
| 198 |
+
"error_audio": "Please upload audio first",
|
| 199 |
+
"error_model": "Please select model first",
|
| 200 |
+
"error_generate_first": "Generate a cover at least once first!",
|
| 201 |
+
|
| 202 |
+
"vbach_required": "Vbach (RVC) is not installed. In the notebook, run the 'Установка' cell with the flag install_vbach [✓]"
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
CURRENT_LANG = "ru"
|
| 207 |
+
|
| 208 |
+
def set_language(lang):
|
| 209 |
+
global CURRENT_LANG
|
| 210 |
+
CURRENT_LANG = lang
|
| 211 |
+
|
| 212 |
+
def t(key):
|
| 213 |
+
"""Функция для получения перевода"""
|
| 214 |
+
return TRANSLATIONS[CURRENT_LANG].get(key, key)
|
| 215 |
+
|
| 216 |
+
def list_models(category, model_type=None):
|
| 217 |
+
list_models = []
|
| 218 |
+
if not model_type:
|
| 219 |
+
for m_type in list(mvsepless_models.keys()):
|
| 220 |
+
for m_name in list(mvsepless_models[m_type].keys()):
|
| 221 |
+
if mvsepless_models[m_type][m_name]["category"] in category:
|
| 222 |
+
list_models.append(f"{m_type} / {m_name}")
|
| 223 |
+
else:
|
| 224 |
+
for m_type in model_type:
|
| 225 |
+
for m_name in list(mvsepless_models[m_type].keys()):
|
| 226 |
+
if mvsepless_models[m_type][m_name]["category"] in category:
|
| 227 |
+
list_models.append(f"{m_type} / {m_name}")
|
| 228 |
+
return list_models
|
| 229 |
+
|
| 230 |
+
def find_file_from_stem(results, stem_names=["Vocals", "vocals"]):
|
| 231 |
+
for stem_name, stem_file in results:
|
| 232 |
+
if stem_name in stem_names:
|
| 233 |
+
stem_path = stem_file
|
| 234 |
+
return stem_path
|
| 235 |
+
|
| 236 |
+
def mix_and_save(
|
| 237 |
+
inst_path,
|
| 238 |
+
list_vocals,
|
| 239 |
+
converted_vocals_list,
|
| 240 |
+
mix_params,
|
| 241 |
+
params,
|
| 242 |
+
rvc_params,
|
| 243 |
+
temp_dir,
|
| 244 |
+
input_audio
|
| 245 |
+
):
|
| 246 |
+
# Mixing
|
| 247 |
+
final_audio = None
|
| 248 |
+
samplerate = 44100
|
| 249 |
+
|
| 250 |
+
# Load instrumental
|
| 251 |
+
if inst_path and os.path.exists(inst_path):
|
| 252 |
+
inst_data, samplerate = librosa.load(inst_path, mono=False, sr=None, dtype='float32')
|
| 253 |
+
if inst_data.ndim == 1:
|
| 254 |
+
inst_data = np.expand_dims(inst_data, axis=0) # (1, n) mono → (1, n)
|
| 255 |
+
inst_gain = 10 ** (mix_params["gain"]["instrum"] / 20.0)
|
| 256 |
+
inst_data *= inst_gain
|
| 257 |
+
final_audio = inst_data.copy()
|
| 258 |
+
|
| 259 |
+
# Add unconverted vocals if requested
|
| 260 |
+
if mix_params["add_unconverted_vocals_to_instrumental"]:
|
| 261 |
+
if params["conversion_mode"] == "lead" and list_vocals[1][1]:
|
| 262 |
+
back_vocals, _ = librosa.load(list_vocals[1][1], mono=False, sr=samplerate, dtype='float32')
|
| 263 |
+
if back_vocals.ndim == 1:
|
| 264 |
+
back_vocals = np.expand_dims(back_vocals, axis=0)
|
| 265 |
+
final_audio = back_vocals * (10 ** (mix_params["gain"]["vocals2"] / 20.0)) if final_audio is None else final_audio + back_vocals * (10 ** (mix_params["gain"]["vocals2"] / 20.0))
|
| 266 |
+
elif params["conversion_mode"] == "back" and list_vocals[2][1]:
|
| 267 |
+
lead_vocals, _ = librosa.load(list_vocals[2][1], mono=False, sr=samplerate, dtype='float32')
|
| 268 |
+
if lead_vocals.ndim == 1:
|
| 269 |
+
lead_vocals = np.expand_dims(lead_vocals, axis=0)
|
| 270 |
+
final_audio = lead_vocals * (10 ** (mix_params["gain"]["vocals1"] / 20.0)) if final_audio is None else final_audio + lead_vocals * (10 ** (mix_params["gain"]["vocals1"] / 20.0))
|
| 271 |
+
|
| 272 |
+
# Process converted vocals
|
| 273 |
+
for i, vocal_path in enumerate(converted_vocals_list):
|
| 274 |
+
if not vocal_path or not os.path.exists(vocal_path):
|
| 275 |
+
continue
|
| 276 |
+
|
| 277 |
+
vocal_data, sr = librosa.load(vocal_path, mono=False, sr=None, dtype='float32')
|
| 278 |
+
if vocal_data.ndim == 1:
|
| 279 |
+
vocal_data = np.expand_dims(vocal_data, axis=0)
|
| 280 |
+
|
| 281 |
+
# Resample if needed
|
| 282 |
+
if sr != samplerate:
|
| 283 |
+
audio_segment = AudioSegment.from_wav(vocal_path)
|
| 284 |
+
audio_segment = audio_segment.set_frame_rate(samplerate)
|
| 285 |
+
samples = np.array(audio_segment.get_array_of_samples())
|
| 286 |
+
channels = audio_segment.channels
|
| 287 |
+
|
| 288 |
+
samples = samples.astype(np.float32)
|
| 289 |
+
max_value = 2 ** (8 * audio_segment.sample_width - 1)
|
| 290 |
+
samples /= max_value
|
| 291 |
+
|
| 292 |
+
vocal_data = samples.reshape((-1, channels)).T # shape: (channels, n_samples)
|
| 293 |
+
|
| 294 |
+
# Apply effects
|
| 295 |
+
if mix_params.get("use_effects", False):
|
| 296 |
+
board = Pedalboard()
|
| 297 |
+
effects = mix_params.get("pedalboard_settings", {})
|
| 298 |
+
|
| 299 |
+
if "compressor" in effects:
|
| 300 |
+
comp = effects["compressor"]
|
| 301 |
+
board.append(Compressor(
|
| 302 |
+
ratio=comp["ratio"],
|
| 303 |
+
threshold_db=comp["threshold"],
|
| 304 |
+
attack_ms=comp["attack"],
|
| 305 |
+
release_ms=comp["release"]
|
| 306 |
+
))
|
| 307 |
+
|
| 308 |
+
if "noise_gate" in effects:
|
| 309 |
+
ng = effects["noise_gate"]
|
| 310 |
+
board.append(NoiseGate(
|
| 311 |
+
threshold_db=ng["threshold"],
|
| 312 |
+
ratio=ng["ratio"],
|
| 313 |
+
attack_ms=ng["attack"],
|
| 314 |
+
release_ms=ng["release"]
|
| 315 |
+
))
|
| 316 |
+
|
| 317 |
+
if "echo" in effects:
|
| 318 |
+
echo = effects["echo"]
|
| 319 |
+
board.append(Delay(
|
| 320 |
+
delay_seconds=echo["delay"],
|
| 321 |
+
feedback=echo["feedback"],
|
| 322 |
+
mix=echo["mix"]
|
| 323 |
+
))
|
| 324 |
+
|
| 325 |
+
if "reverb" in effects:
|
| 326 |
+
rev = effects["reverb"]
|
| 327 |
+
board.append(Reverb(
|
| 328 |
+
room_size=rev["room_size"],
|
| 329 |
+
dry_level=rev["dry"],
|
| 330 |
+
wet_level=rev["wet"],
|
| 331 |
+
damping=rev["damping"],
|
| 332 |
+
width=rev["width"]
|
| 333 |
+
))
|
| 334 |
+
|
| 335 |
+
if "chorus" in effects:
|
| 336 |
+
chorus = effects["chorus"]
|
| 337 |
+
board.append(Chorus(
|
| 338 |
+
rate_hz=chorus["rate"],
|
| 339 |
+
depth=chorus["depth"],
|
| 340 |
+
centre_delay_ms=chorus["center_delay"],
|
| 341 |
+
feedback=chorus["feedback"],
|
| 342 |
+
mix=chorus["mix"]
|
| 343 |
+
))
|
| 344 |
+
|
| 345 |
+
vocal_data = board(vocal_data, samplerate)
|
| 346 |
+
|
| 347 |
+
# Apply gain
|
| 348 |
+
gain_db = mix_params["gain"]["vocals1"] if i == 0 else mix_params["gain"]["vocals2"]
|
| 349 |
+
vocal_data *= 10 ** (gain_db / 20.0)
|
| 350 |
+
|
| 351 |
+
# Mix vocals into final
|
| 352 |
+
if final_audio is None:
|
| 353 |
+
final_audio = vocal_data.copy()
|
| 354 |
+
else:
|
| 355 |
+
# Ensure equal shape
|
| 356 |
+
min_len = min(final_audio.shape[1], vocal_data.shape[1])
|
| 357 |
+
final_audio = final_audio[:, :min_len] + vocal_data[:, :min_len]
|
| 358 |
+
|
| 359 |
+
# Save output
|
| 360 |
+
max_amplitude = np.max(np.abs(final_audio))
|
| 361 |
+
if max_amplitude > 0:
|
| 362 |
+
normalization_factor = 1.0 / max_amplitude
|
| 363 |
+
final_audio = final_audio * normalization_factor
|
| 364 |
+
filename = f"{rvc_params['model_name']} - {os.path.splitext(os.path.basename(input_audio))[0]}.{params['output_format']}" if input_audio else f"remixed.{params['output_format']}"
|
| 365 |
+
final_path = os.path.join(temp_dir, filename)
|
| 366 |
+
write_audio_file(final_path, final_audio, samplerate, params['output_format'], "320k")
|
| 367 |
+
|
| 368 |
+
return final_path
|
| 369 |
+
|
| 370 |
+
def gen_cover(
|
| 371 |
+
input_audio,
|
| 372 |
+
anti_instrum_model,
|
| 373 |
+
karaoke_model,
|
| 374 |
+
dereverb_model,
|
| 375 |
+
output_format,
|
| 376 |
+
karaoke_check,
|
| 377 |
+
conversion_mode,
|
| 378 |
+
preclear_vocals_check,
|
| 379 |
+
voice_name,
|
| 380 |
+
pitch1_val,
|
| 381 |
+
pitch2_val,
|
| 382 |
+
method_pitch,
|
| 383 |
+
index_rate,
|
| 384 |
+
fr,
|
| 385 |
+
rms,
|
| 386 |
+
protect,
|
| 387 |
+
hop_mangio_crepe,
|
| 388 |
+
f0_max,
|
| 389 |
+
unconv_vocals_check,
|
| 390 |
+
use_effects,
|
| 391 |
+
instrumental_gain,
|
| 392 |
+
vocal1_gain,
|
| 393 |
+
vocal2_gain,
|
| 394 |
+
echo_delay,
|
| 395 |
+
echo_feedback,
|
| 396 |
+
echo_mix,
|
| 397 |
+
reverb_rm_size,
|
| 398 |
+
reverb_width,
|
| 399 |
+
reverb_wet,
|
| 400 |
+
reverb_dry,
|
| 401 |
+
reverb_damping,
|
| 402 |
+
chorus_rate_hz,
|
| 403 |
+
chorus_depth,
|
| 404 |
+
chorus_centre_delay_ms,
|
| 405 |
+
chorus_feedback,
|
| 406 |
+
chorus_mix,
|
| 407 |
+
compressor_ratio,
|
| 408 |
+
compressor_threshold,
|
| 409 |
+
compressor_attack,
|
| 410 |
+
compressor_release,
|
| 411 |
+
noise_gate_threshold,
|
| 412 |
+
noise_gate_ratio,
|
| 413 |
+
noise_gate_attack,
|
| 414 |
+
noise_gate_release
|
| 415 |
+
):
|
| 416 |
+
|
| 417 |
+
global saved_processing_data
|
| 418 |
+
|
| 419 |
+
if not input_audio and not voice_name:
|
| 420 |
+
raise gr.Error(t("error_audio_model"))
|
| 421 |
+
|
| 422 |
+
if not input_audio:
|
| 423 |
+
raise gr.Error(t("error_audio"))
|
| 424 |
+
|
| 425 |
+
if not voice_name:
|
| 426 |
+
raise gr.Error(t("error_model"))
|
| 427 |
+
|
| 428 |
+
# Собираем параметры в структуры
|
| 429 |
+
models = [
|
| 430 |
+
anti_instrum_model,
|
| 431 |
+
karaoke_model,
|
| 432 |
+
dereverb_model
|
| 433 |
+
]
|
| 434 |
+
|
| 435 |
+
params = {
|
| 436 |
+
"output_format": output_format,
|
| 437 |
+
"extract_karaoke": karaoke_check,
|
| 438 |
+
"conversion_mode": conversion_mode,
|
| 439 |
+
"preclear_vocals": preclear_vocals_check
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
rvc_params = {
|
| 443 |
+
"model_name": voice_name,
|
| 444 |
+
"pitch1": pitch1_val,
|
| 445 |
+
"pitch2": pitch2_val,
|
| 446 |
+
"f0_method": method_pitch,
|
| 447 |
+
'index_rate': index_rate,
|
| 448 |
+
'filter_radius': fr,
|
| 449 |
+
'rms': rms,
|
| 450 |
+
'protect': protect,
|
| 451 |
+
'hop_length': hop_mangio_crepe,
|
| 452 |
+
'f0_max': f0_max
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
mix_params = {
|
| 456 |
+
"add_unconverted_vocals_to_instrumental": unconv_vocals_check,
|
| 457 |
+
"use_effects": use_effects,
|
| 458 |
+
"gain": {
|
| 459 |
+
"instrum": instrumental_gain,
|
| 460 |
+
"vocals1": vocal1_gain,
|
| 461 |
+
"vocals2": vocal2_gain
|
| 462 |
+
},
|
| 463 |
+
"pedalboard_settings": {
|
| 464 |
+
"echo": {
|
| 465 |
+
"delay": echo_delay,
|
| 466 |
+
"feedback": echo_feedback,
|
| 467 |
+
"mix": echo_mix
|
| 468 |
+
},
|
| 469 |
+
"reverb": {
|
| 470 |
+
"room_size": reverb_rm_size,
|
| 471 |
+
"wet": reverb_wet,
|
| 472 |
+
"dry": reverb_dry,
|
| 473 |
+
"damping": reverb_damping,
|
| 474 |
+
"width": reverb_width,
|
| 475 |
+
},
|
| 476 |
+
"compressor": {
|
| 477 |
+
"ratio": compressor_ratio,
|
| 478 |
+
"threshold": compressor_threshold,
|
| 479 |
+
"attack": compressor_attack,
|
| 480 |
+
"release": compressor_release
|
| 481 |
+
},
|
| 482 |
+
"noise_gate": {
|
| 483 |
+
"threshold": noise_gate_threshold,
|
| 484 |
+
"ratio": noise_gate_ratio,
|
| 485 |
+
"attack": noise_gate_attack,
|
| 486 |
+
"release": noise_gate_release,
|
| 487 |
+
},
|
| 488 |
+
"chorus": {
|
| 489 |
+
"rate": chorus_rate_hz,
|
| 490 |
+
"depth": chorus_depth,
|
| 491 |
+
"center_delay": chorus_centre_delay_ms,
|
| 492 |
+
"feedback": chorus_feedback,
|
| 493 |
+
"mix": chorus_mix
|
| 494 |
+
}
|
| 495 |
+
}
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
progress = gr.Progress()
|
| 499 |
+
|
| 500 |
+
progress(0, desc=t("start_processing"))
|
| 501 |
+
|
| 502 |
+
generated_files = []
|
| 503 |
+
converted_vocals_list = []
|
| 504 |
+
temp_dir = tempfile.mkdtemp()
|
| 505 |
+
inst_model = models[0]
|
| 506 |
+
kar_model = models[1]
|
| 507 |
+
dereverb_model = models[2]
|
| 508 |
+
|
| 509 |
+
progress(0.1, desc=t("separation"))
|
| 510 |
+
|
| 511 |
+
# Separate vocals and instrumental
|
| 512 |
+
inst_output = single_multi_inference(input_audio, os.path.join(temp_dir, "inst_output"),
|
| 513 |
+
inst_model.split(" / ")[0], inst_model.split(" / ")[1],
|
| 514 |
+
True, vr_aggr=5, output_format="wav",
|
| 515 |
+
output_bitrate="320k", template="VbachGen_NAME_STEM",
|
| 516 |
+
call_method="cli", selected_stems=[])
|
| 517 |
+
inst_file = ("instrumental", find_file_from_stem(inst_output, ["Instrumental", "instrumental", "other", "Other"]))
|
| 518 |
+
full_vocals_file = ("full_vocals", find_file_from_stem(inst_output, ["Vocals", "vocals"]))
|
| 519 |
+
|
| 520 |
+
progress(0.2, desc=t("extracting"))
|
| 521 |
+
|
| 522 |
+
back_vocals_file = (None, None)
|
| 523 |
+
lead_vocals_file = (None, None)
|
| 524 |
+
|
| 525 |
+
if params["extract_karaoke"] == True:
|
| 526 |
+
karaoke_output = single_multi_inference(full_vocals_file[1], os.path.join(temp_dir, "kar_output"),
|
| 527 |
+
kar_model.split(" / ")[0], kar_model.split(" / ")[1],
|
| 528 |
+
True, vr_aggr=5, output_format="wav",
|
| 529 |
+
output_bitrate="320k", template="NAME_MODEL_STEM",
|
| 530 |
+
call_method="cli", selected_stems=[])
|
| 531 |
+
back_vocals_file = ("back_vocals", find_file_from_stem(karaoke_output, ["Instrumental", "instrumental", "other", "Other"]))
|
| 532 |
+
lead_vocals_file = ("lead_vocals", find_file_from_stem(karaoke_output, ["Vocals", "vocals", "karaoke"]))
|
| 533 |
+
|
| 534 |
+
list_vocals = [
|
| 535 |
+
full_vocals_file,
|
| 536 |
+
back_vocals_file if params["extract_karaoke"] else (None, None),
|
| 537 |
+
lead_vocals_file if params["extract_karaoke"] else (None, None)
|
| 538 |
+
]
|
| 539 |
+
|
| 540 |
+
clear_list_vocals = [
|
| 541 |
+
full_vocals_file,
|
| 542 |
+
back_vocals_file if params["extract_karaoke"] and params["conversion_mode"] in ["back", "lead/back"] else (None, None),
|
| 543 |
+
lead_vocals_file if params["extract_karaoke"] and params["conversion_mode"] in ["lead", "lead/back"] else (None, None)
|
| 544 |
+
]
|
| 545 |
+
|
| 546 |
+
progress(0.3, desc=t("cleaning"))
|
| 547 |
+
|
| 548 |
+
# Pre-clear vocals if needed
|
| 549 |
+
cleared_vocals = []
|
| 550 |
+
if params["preclear_vocals"] == True:
|
| 551 |
+
for i, (name, file) in enumerate(clear_list_vocals):
|
| 552 |
+
if file and os.path.exists(file):
|
| 553 |
+
clear_output = single_multi_inference(file, os.path.join(temp_dir, f"cleared_output_{i}"),
|
| 554 |
+
dereverb_model.split(" / ")[0], dereverb_model.split(" / ")[1],
|
| 555 |
+
True, vr_aggr=5, output_format="wav",
|
| 556 |
+
output_bitrate="320k", template="NAME_STEM",
|
| 557 |
+
call_method="cli", selected_stems=[])
|
| 558 |
+
cleared_file = find_file_from_stem(clear_output, ["No Echo", "No Reverb", "Dry", "Other"])
|
| 559 |
+
cleared_vocals.append((name, cleared_file))
|
| 560 |
+
for i, voc in enumerate(list_vocals):
|
| 561 |
+
for clear_voc in cleared_vocals:
|
| 562 |
+
if clear_voc[0] == voc[0]:
|
| 563 |
+
list_vocals[i] = clear_voc
|
| 564 |
+
break
|
| 565 |
+
|
| 566 |
+
progress(0.5, desc=t("converting"))
|
| 567 |
+
|
| 568 |
+
# Vocal conversion
|
| 569 |
+
if params["conversion_mode"] == "full" and list_vocals[0][1]:
|
| 570 |
+
full_vocals_converted_path = os.path.join(os.path.join(temp_dir, 'converted'), "full_vocals_converted.wav")
|
| 571 |
+
cmd = f"python -m vbach.cli.vbach '{list_vocals[0][1]}' '{os.path.join(temp_dir, 'converted')}' '{rvc_params['model_name']}' --template 'full_vocals_converted' --pitch {rvc_params['pitch1']} --method_pitch {rvc_params['f0_method']} --index_rate {rvc_params['index_rate']} --filter_radius {rvc_params['filter_radius']} --rms {rvc_params['rms']} --protect {rvc_params['protect']} --hop_length {rvc_params['hop_length']} --f0_min 50 --f0_max {rvc_params['f0_max']} --output_format wav --stereo_mode 'mono'"
|
| 572 |
+
os.system(cmd)
|
| 573 |
+
converted_vocals_list.append(full_vocals_converted_path)
|
| 574 |
+
|
| 575 |
+
elif params["conversion_mode"] == "lead/back" and list_vocals[1][1] and list_vocals[2][1]:
|
| 576 |
+
lead_vocals_converted_path = os.path.join(os.path.join(temp_dir, 'converted'), "lead_vocals_converted.wav")
|
| 577 |
+
cmd = f"python -m vbach.cli.vbach '{list_vocals[2][1]}' '{os.path.join(temp_dir, 'converted')}' '{rvc_params['model_name']}' --template 'lead_vocals_converted' --pitch {rvc_params['pitch1']} --method_pitch {rvc_params['f0_method']} --index_rate {rvc_params['index_rate']} --filter_radius {rvc_params['filter_radius']} --rms {rvc_params['rms']} --protect {rvc_params['protect']} --hop_length {rvc_params['hop_length']} --f0_min 50 --f0_max {rvc_params['f0_max']} --output_format wav --stereo_mode 'mono'"
|
| 578 |
+
os.system(cmd)
|
| 579 |
+
|
| 580 |
+
back_vocals_converted_path = os.path.join(os.path.join(temp_dir, 'converted'), "back_vocals_converted.wav")
|
| 581 |
+
cmd = f"python -m vbach.cli.vbach '{list_vocals[1][1]}' '{os.path.join(temp_dir, 'converted')}' '{rvc_params['model_name']}' --template 'back_vocals_converted' --pitch {rvc_params['pitch2']} --method_pitch {rvc_params['f0_method']} --index_rate {rvc_params['index_rate']} --filter_radius {rvc_params['filter_radius']} --rms {rvc_params['rms']} --protect {rvc_params['protect']} --hop_length {rvc_params['hop_length']} --f0_min 50 --f0_max {rvc_params['f0_max']} --output_format wav --stereo_mode 'mono'"
|
| 582 |
+
os.system(cmd)
|
| 583 |
+
|
| 584 |
+
converted_vocals_list.append(back_vocals_converted_path)
|
| 585 |
+
converted_vocals_list.append(lead_vocals_converted_path)
|
| 586 |
+
|
| 587 |
+
elif params["conversion_mode"] == "back" and list_vocals[1][1]:
|
| 588 |
+
back_vocals_converted_path = os.path.join(os.path.join(temp_dir, 'converted'), "back_vocals_converted.wav")
|
| 589 |
+
cmd = f"python -m vbach.cli.vbach '{list_vocals[1][1]}' '{os.path.join(temp_dir, 'converted')}' '{rvc_params['model_name']}' --template 'back_vocals_converted' --pitch {rvc_params['pitch2']} --method_pitch {rvc_params['f0_method']} --index_rate {rvc_params['index_rate']} --filter_radius {rvc_params['filter_radius']} --rms {rvc_params['protect']} --protect {rvc_params['rms']} --hop_length {rvc_params['hop_length']} --f0_min 50 --f0_max {rvc_params['f0_max']} --output_format wav --stereo_mode 'mono'"
|
| 590 |
+
os.system(cmd)
|
| 591 |
+
converted_vocals_list.append(back_vocals_converted_path)
|
| 592 |
+
|
| 593 |
+
elif params["conversion_mode"] == "lead" and list_vocals[2][1]:
|
| 594 |
+
lead_vocals_converted_path = os.path.join(os.path.join(temp_dir, 'converted'), "lead_vocals_converted.wav")
|
| 595 |
+
cmd = f"python -m vbach.cli.vbach '{list_vocals[2][1]}' '{os.path.join(temp_dir, 'converted')}' '{rvc_params['model_name']}' --template 'lead_vocals_converted' --pitch {rvc_params['pitch1']} --method_pitch {rvc_params['f0_method']} --index_rate {rvc_params['index_rate']} --filter_radius {rvc_params['filter_radius']} --rms {rvc_params['rms']} --protect {rvc_params['protect']} --hop_length {rvc_params['hop_length']} --f0_min 50 --f0_max {rvc_params['f0_max']} --output_format wav --stereo_mode 'mono'"
|
| 596 |
+
os.system(cmd)
|
| 597 |
+
converted_vocals_list.append(lead_vocals_converted_path)
|
| 598 |
+
|
| 599 |
+
# Prepare files list
|
| 600 |
+
generated_files.append(inst_file[1])
|
| 601 |
+
for name, file in list_vocals:
|
| 602 |
+
if file:
|
| 603 |
+
generated_files.append(file)
|
| 604 |
+
generated_files.extend(converted_vocals_list)
|
| 605 |
+
|
| 606 |
+
# Сохраняем данные для возможного пересведения
|
| 607 |
+
saved_processing_data = {
|
| 608 |
+
"inst_path": inst_file[1],
|
| 609 |
+
"list_vocals": list_vocals,
|
| 610 |
+
"converted_vocals_list": converted_vocals_list,
|
| 611 |
+
"params": params,
|
| 612 |
+
"rvc_params": rvc_params,
|
| 613 |
+
"input_audio": input_audio
|
| 614 |
+
}
|
| 615 |
+
|
| 616 |
+
progress(0.9, desc=t("mixing"))
|
| 617 |
+
|
| 618 |
+
# Сведение
|
| 619 |
+
final_path = mix_and_save(
|
| 620 |
+
inst_file[1],
|
| 621 |
+
list_vocals,
|
| 622 |
+
converted_vocals_list,
|
| 623 |
+
mix_params,
|
| 624 |
+
params,
|
| 625 |
+
rvc_params,
|
| 626 |
+
temp_dir,
|
| 627 |
+
input_audio
|
| 628 |
+
)
|
| 629 |
+
|
| 630 |
+
generated_files.append(final_path)
|
| 631 |
+
|
| 632 |
+
return generated_files, final_path
|
| 633 |
+
|
| 634 |
+
def remix_cover(
|
| 635 |
+
use_effects,
|
| 636 |
+
instrumental_gain,
|
| 637 |
+
vocal1_gain,
|
| 638 |
+
vocal2_gain,
|
| 639 |
+
echo_delay,
|
| 640 |
+
echo_feedback,
|
| 641 |
+
echo_mix,
|
| 642 |
+
reverb_rm_size,
|
| 643 |
+
reverb_width,
|
| 644 |
+
reverb_wet,
|
| 645 |
+
reverb_dry,
|
| 646 |
+
reverb_damping,
|
| 647 |
+
chorus_rate_hz,
|
| 648 |
+
chorus_depth,
|
| 649 |
+
chorus_centre_delay_ms,
|
| 650 |
+
chorus_feedback,
|
| 651 |
+
chorus_mix,
|
| 652 |
+
compressor_ratio,
|
| 653 |
+
compressor_threshold,
|
| 654 |
+
compressor_attack,
|
| 655 |
+
compressor_release,
|
| 656 |
+
noise_gate_threshold,
|
| 657 |
+
noise_gate_ratio,
|
| 658 |
+
noise_gate_attack,
|
| 659 |
+
noise_gate_release
|
| 660 |
+
):
|
| 661 |
+
global saved_processing_data
|
| 662 |
+
if not saved_processing_data:
|
| 663 |
+
raise gr.Error(t("error_generate_first"))
|
| 664 |
+
|
| 665 |
+
# Восстанавливаем данные из сохраненной сессии
|
| 666 |
+
data = saved_processing_data
|
| 667 |
+
temp_dir = tempfile.mkdtemp()
|
| 668 |
+
|
| 669 |
+
# Подготавливаем параметры для сведения
|
| 670 |
+
mix_params = {
|
| 671 |
+
"add_unconverted_vocals_to_instrumental": True, # Всегда используем оригинальные вокалы
|
| 672 |
+
"use_effects": use_effects,
|
| 673 |
+
"gain": {
|
| 674 |
+
"instrum": instrumental_gain,
|
| 675 |
+
"vocals1": vocal1_gain,
|
| 676 |
+
"vocals2": vocal2_gain
|
| 677 |
+
},
|
| 678 |
+
"pedalboard_settings": {
|
| 679 |
+
"echo": {
|
| 680 |
+
"delay": echo_delay,
|
| 681 |
+
"feedback": echo_feedback,
|
| 682 |
+
"mix": echo_mix
|
| 683 |
+
},
|
| 684 |
+
"reverb": {
|
| 685 |
+
"room_size": reverb_rm_size,
|
| 686 |
+
"wet": reverb_wet,
|
| 687 |
+
"dry": reverb_dry,
|
| 688 |
+
"damping": reverb_damping,
|
| 689 |
+
"width": reverb_width,
|
| 690 |
+
},
|
| 691 |
+
"compressor": {
|
| 692 |
+
"ratio": compressor_ratio,
|
| 693 |
+
"threshold": compressor_threshold,
|
| 694 |
+
"attack": compressor_attack,
|
| 695 |
+
"release": compressor_release
|
| 696 |
+
},
|
| 697 |
+
"noise_gate": {
|
| 698 |
+
"threshold": noise_gate_threshold,
|
| 699 |
+
"ratio": noise_gate_ratio,
|
| 700 |
+
"attack": noise_gate_attack,
|
| 701 |
+
"release": noise_gate_release,
|
| 702 |
+
},
|
| 703 |
+
"chorus": {
|
| 704 |
+
"rate": chorus_rate_hz,
|
| 705 |
+
"depth": chorus_depth,
|
| 706 |
+
"center_delay": chorus_centre_delay_ms,
|
| 707 |
+
"feedback": chorus_feedback,
|
| 708 |
+
"mix": chorus_mix
|
| 709 |
+
}
|
| 710 |
+
}
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
# Запускаем только этап сведения
|
| 714 |
+
final_path = mix_and_save(
|
| 715 |
+
data["inst_path"],
|
| 716 |
+
data["list_vocals"],
|
| 717 |
+
data["converted_vocals_list"],
|
| 718 |
+
mix_params,
|
| 719 |
+
data["params"],
|
| 720 |
+
data["rvc_params"],
|
| 721 |
+
temp_dir,
|
| 722 |
+
data["input_audio"]
|
| 723 |
+
)
|
| 724 |
+
|
| 725 |
+
return final_path
|
| 726 |
+
|
| 727 |
+
def vbach_plugin_name():
|
| 728 |
+
return "VbachGen"
|
| 729 |
+
|
| 730 |
+
def vbachgen_plugin(lang):
|
| 731 |
+
set_language(lang)
|
| 732 |
+
with gr.Blocks():
|
| 733 |
+
if os.path.exists("vbach"):
|
| 734 |
+
with gr.Row(equal_height=False, variant="panel"):
|
| 735 |
+
with gr.Column():
|
| 736 |
+
model_name = gr.Dropdown(label=t("model_name_label"), interactive=True, filterable=False, scale=6)
|
| 737 |
+
model_update_btn = gr.Button(t("update_button"), variant="primary", scale=3, size="lg")
|
| 738 |
+
with gr.Row(min_height=150):
|
| 739 |
+
input_audio = gr.File(label=t("input_audio_label"), interactive=True, type="filepath", file_count="single")
|
| 740 |
+
|
| 741 |
+
with gr.Row():
|
| 742 |
+
with gr.Column():
|
| 743 |
+
|
| 744 |
+
with gr.Tab(t("tab_separation")):
|
| 745 |
+
preclear_vocals_check = gr.Checkbox(label=t("preclear_vocals"), value=False)
|
| 746 |
+
karaoke_check = gr.Checkbox(label=t("split_vocals"), value=False)
|
| 747 |
+
|
| 748 |
+
with gr.Column(variant="panel"):
|
| 749 |
+
with gr.Group() as extract_vocals_group:
|
| 750 |
+
anti_instrum_model = gr.Dropdown(
|
| 751 |
+
label=t("vocal_model"),
|
| 752 |
+
choices=list_models(["Инструментал", "Вокал", "Инструментал и вокал"], ["mel_band_roformer", "bs_roformer", "mdx23c", "mdx", "htdemucs"]),
|
| 753 |
+
interactive=True,
|
| 754 |
+
filterable=False
|
| 755 |
+
)
|
| 756 |
+
|
| 757 |
+
with gr.Group(visible=False) as deecho_group:
|
| 758 |
+
dereverb_model = gr.Dropdown(
|
| 759 |
+
label=t("dereverb_model"),
|
| 760 |
+
choices=list_models(["Реверб и эхо", "Реверб", "Эхо"], ["vr"]),
|
| 761 |
+
interactive=True,
|
| 762 |
+
filterable=False
|
| 763 |
+
)
|
| 764 |
+
|
| 765 |
+
with gr.Group(visible=False) as karaoke_group:
|
| 766 |
+
karaoke_model = gr.Dropdown(
|
| 767 |
+
label=t("karaoke_model"),
|
| 768 |
+
choices=list_models(["Караоке"]),
|
| 769 |
+
interactive=True,
|
| 770 |
+
filterable=False
|
| 771 |
+
)
|
| 772 |
+
|
| 773 |
+
|
| 774 |
+
with gr.Tab(t("tab_voice_settings")):
|
| 775 |
+
conversion_mode = gr.Dropdown(
|
| 776 |
+
label=t("conversion_mode"),
|
| 777 |
+
choices=["lead", "back", "lead/back", "full"],
|
| 778 |
+
value="full",
|
| 779 |
+
filterable=False,
|
| 780 |
+
visible=False,
|
| 781 |
+
info=t("conversion_info")
|
| 782 |
+
)
|
| 783 |
+
with gr.Row():
|
| 784 |
+
pitch1 = gr.Slider(-48, 48, value=0, step=12, label=t("vocal_pitch"), interactive=True)
|
| 785 |
+
pitch2 = gr.Slider(-48, 48, value=0, step=12, label=t("backing_pitch"), visible=False, interactive=True)
|
| 786 |
+
with gr.Row():
|
| 787 |
+
method_pitch = gr.Dropdown(
|
| 788 |
+
label=t("pitch_method"),
|
| 789 |
+
choices=["mangio-crepe", "rmvpe+", "fcpe"],
|
| 790 |
+
value="rmvpe+",
|
| 791 |
+
interactive=True,
|
| 792 |
+
filterable=False
|
| 793 |
+
)
|
| 794 |
+
f0_max = gr.Slider(50, 2000, value=1100, step=50, label=t("max_pitch"), interactive=True)
|
| 795 |
+
with gr.Row():
|
| 796 |
+
with gr.Column(scale=1):
|
| 797 |
+
index_rate = gr.Slider(0, 1, value=0, step=0.1, label=t("index_rate"), interactive=True)
|
| 798 |
+
fr = gr.Slider(0, 7, value=3, step=1, label=t("filter_radius"), interactive=True)
|
| 799 |
+
with gr.Column(scale=1):
|
| 800 |
+
rms = gr.Slider(0, 1, value=0.25, step=0.05, label=t("rms_envelope"), interactive=True)
|
| 801 |
+
protect = gr.Slider(minimum=0, maximum=0.5, step=0.01, value=0.33, label=t("protect_cons"), interactive=True)
|
| 802 |
+
hop_mangio_crepe = gr.Slider(1, 512, value=128, step=1, label=t("hop_length"), interactive=True, visible=False)
|
| 803 |
+
|
| 804 |
+
|
| 805 |
+
with gr.Tab(t("tab_mixing_settings")):
|
| 806 |
+
gr.Markdown(f"<center><h2>{t('volume_adjust')}</h2></center>")
|
| 807 |
+
with gr.Row(variant="panel"):
|
| 808 |
+
vocal1_gain = gr.Slider(-30, 30, value=0, step=1, label=t("vocals_gain"), scale=3, interactive=True)
|
| 809 |
+
vocal2_gain = gr.Slider(-30, 30, value=0, step=1, label=t("backing_gain"), scale=3, visible=False, interactive=True)
|
| 810 |
+
instrumental_gain = gr.Slider(-30, 30, value=0, step=1, label=t("inst_gain"), scale=3, interactive=True)
|
| 811 |
+
|
| 812 |
+
output_format = gr.Dropdown(
|
| 813 |
+
label=t("output_format"),
|
| 814 |
+
choices=OUTPUT_FORMAT,
|
| 815 |
+
value="wav",
|
| 816 |
+
interactive=True,
|
| 817 |
+
filterable=False
|
| 818 |
+
)
|
| 819 |
+
unconv_vocals_check = gr.Checkbox(label=t("add_unconv"), visible=False)
|
| 820 |
+
use_effects = gr.Checkbox(label=t("add_effects"), value=False)
|
| 821 |
+
with gr.Column(variant="panel", visible=False) as effects_accordion:
|
| 822 |
+
with gr.Tab(t("effects_tab")):
|
| 823 |
+
with gr.Tab(t("echo_tab")):
|
| 824 |
+
with gr.Group():
|
| 825 |
+
with gr.Column(variant="panel"):
|
| 826 |
+
with gr.Row():
|
| 827 |
+
echo_delay = gr.Slider(0, 3, value=0, label=t("echo_delay"), interactive=True)
|
| 828 |
+
echo_feedback = gr.Slider(0, 1, value=0, label=t("echo_feedback"), interactive=True)
|
| 829 |
+
echo_mix = gr.Slider(0, 1, value=0, label=t("echo_mix"), interactive=True)
|
| 830 |
+
|
| 831 |
+
with gr.Tab(t("reverb_tab")):
|
| 832 |
+
with gr.Group():
|
| 833 |
+
with gr.Column(variant="panel"):
|
| 834 |
+
with gr.Row():
|
| 835 |
+
reverb_rm_size = gr.Slider(0, 1, value=0.1, label=t("reverb_size"), interactive=True)
|
| 836 |
+
reverb_width = gr.Slider(0, 1, value=1.0, label=t("reverb_width"), interactive=True)
|
| 837 |
+
with gr.Row():
|
| 838 |
+
reverb_wet = gr.Slider(0, 1, value=0.1, label=t("reverb_wet"), interactive=True)
|
| 839 |
+
reverb_dry = gr.Slider(0, 1, value=0.8, label=t("reverb_dry"), interactive=True)
|
| 840 |
+
with gr.Row():
|
| 841 |
+
reverb_damping = gr.Slider(0, 1, value=0.9, label=t("reverb_damping"), interactive=True)
|
| 842 |
+
|
| 843 |
+
with gr.Tab(t("chorus_tab")):
|
| 844 |
+
with gr.Group():
|
| 845 |
+
with gr.Column(variant="panel"):
|
| 846 |
+
with gr.Row():
|
| 847 |
+
chorus_rate_hz = gr.Slider(0.1, 10, value=0, label=t("chorus_rate"), interactive=True)
|
| 848 |
+
chorus_depth = gr.Slider(0, 1, value=0, label=t("chorus_depth"), interactive=True)
|
| 849 |
+
with gr.Row():
|
| 850 |
+
chorus_centre_delay_ms = gr.Slider(0, 50, value=0, label=t("chorus_delay"), interactive=True)
|
| 851 |
+
chorus_feedback = gr.Slider(0, 1, value=0, label=t("chorus_feedback"), interactive=True)
|
| 852 |
+
with gr.Row():
|
| 853 |
+
chorus_mix = gr.Slider(0, 1, value=0, label=t("chorus_mix"), interactive=True)
|
| 854 |
+
|
| 855 |
+
with gr.Tab(t("processing_tab")):
|
| 856 |
+
with gr.Tab(t("compressor_tab")):
|
| 857 |
+
with gr.Row(variant="panel"):
|
| 858 |
+
compressor_ratio = gr.Slider(1, 20, value=4, label=t("comp_ratio"), interactive=True)
|
| 859 |
+
compressor_threshold = gr.Slider(-60, 0, value=-12, label=t("comp_threshold"), interactive=True)
|
| 860 |
+
compressor_attack = gr.Slider(0, 2000, value=100, label=t("comp_attack"), interactive=True)
|
| 861 |
+
compressor_release = gr.Slider(0, 2000, value=100, label=t("comp_release"), interactive=True)
|
| 862 |
+
|
| 863 |
+
with gr.Tab(t("noise_gate_tab")):
|
| 864 |
+
with gr.Group():
|
| 865 |
+
with gr.Column(variant="panel"):
|
| 866 |
+
with gr.Row():
|
| 867 |
+
noise_gate_threshold = gr.Slider(-60, 0, value=-40, label=t("gate_threshold"), interactive=True)
|
| 868 |
+
noise_gate_ratio = gr.Slider(1, 20, value=8, label=t("gate_ratio"), interactive=True)
|
| 869 |
+
with gr.Row():
|
| 870 |
+
noise_gate_attack = gr.Slider(0, 100, value=10, label=t("gate_attack"), interactive=True)
|
| 871 |
+
noise_gate_release = gr.Slider(0, 1000, value=100, label=t("gate_release"), interactive=True)
|
| 872 |
+
|
| 873 |
+
# Outputs
|
| 874 |
+
with gr.Column(variant="panel"):
|
| 875 |
+
final_ai_cover = gr.Audio(label=t("final_result"), interactive=False, streaming=True)
|
| 876 |
+
generated_files_list = gr.Files(label=t("intermediate_files"))
|
| 877 |
+
with gr.Row():
|
| 878 |
+
generate_btn = gr.Button(t("generate_btn"), variant="primary")
|
| 879 |
+
remix_btn = gr.Button(t("remix_btn"), variant="secondary")
|
| 880 |
+
status_text = gr.Textbox(label=t("status_label"), interactive=False)
|
| 881 |
+
|
| 882 |
+
# Event handlers
|
| 883 |
+
method_pitch.change(fn=lambda x: gr.update(visible=True if x == "mangio-crepe" else False), inputs=method_pitch, outputs=hop_mangio_crepe)
|
| 884 |
+
|
| 885 |
+
model_update_btn.click(fn=(lambda : gr.update(choices=[d for d in os.listdir(RVC_MODELS_DIR) if os.path.isdir(os.path.join(RVC_MODELS_DIR, d))])), inputs=None, outputs=model_name)
|
| 886 |
+
|
| 887 |
+
|
| 888 |
+
use_effects.change(
|
| 889 |
+
fn=lambda x: gr.update(visible=x),
|
| 890 |
+
inputs=use_effects,
|
| 891 |
+
outputs=effects_accordion
|
| 892 |
+
)
|
| 893 |
+
|
| 894 |
+
karaoke_check.change(
|
| 895 |
+
fn=lambda x: gr.update(visible=x),
|
| 896 |
+
inputs=karaoke_check,
|
| 897 |
+
outputs=karaoke_group
|
| 898 |
+
).then(fn=lambda x: gr.update(value="full", visible=x), inputs=karaoke_check, outputs=conversion_mode).then(fn=lambda x: gr.update(visible=True if x in ["back", "lead"] else False, value=False), inputs=conversion_mode, outputs=unconv_vocals_check)
|
| 899 |
+
|
| 900 |
+
preclear_vocals_check.change(
|
| 901 |
+
fn=lambda x: gr.update(visible=x),
|
| 902 |
+
inputs=preclear_vocals_check,
|
| 903 |
+
outputs=deecho_group
|
| 904 |
+
)
|
| 905 |
+
|
| 906 |
+
conversion_mode.change(
|
| 907 |
+
fn=lambda mode: (
|
| 908 |
+
gr.update(visible=mode in ["lead", "lead/back"]),
|
| 909 |
+
gr.update(visible=mode in ["back", "lead/back"]),
|
| 910 |
+
gr.update(visible=mode in ["lead/back"])
|
| 911 |
+
),
|
| 912 |
+
inputs=conversion_mode,
|
| 913 |
+
outputs=[vocal1_gain, vocal2_gain, pitch2]
|
| 914 |
+
).then(fn=lambda x: gr.update(visible=True if x in ["back", "lead"] else False, value=False), inputs=conversion_mode, outputs=unconv_vocals_check)
|
| 915 |
+
|
| 916 |
+
generate_btn.click(
|
| 917 |
+
fn=gen_cover,
|
| 918 |
+
inputs=[
|
| 919 |
+
input_audio,
|
| 920 |
+
anti_instrum_model,
|
| 921 |
+
karaoke_model,
|
| 922 |
+
dereverb_model,
|
| 923 |
+
output_format,
|
| 924 |
+
karaoke_check,
|
| 925 |
+
conversion_mode,
|
| 926 |
+
preclear_vocals_check,
|
| 927 |
+
model_name,
|
| 928 |
+
pitch1,
|
| 929 |
+
pitch2,
|
| 930 |
+
method_pitch,
|
| 931 |
+
index_rate,
|
| 932 |
+
fr,
|
| 933 |
+
rms,
|
| 934 |
+
protect,
|
| 935 |
+
hop_mangio_crepe,
|
| 936 |
+
f0_max,
|
| 937 |
+
unconv_vocals_check,
|
| 938 |
+
use_effects,
|
| 939 |
+
instrumental_gain,
|
| 940 |
+
vocal1_gain,
|
| 941 |
+
vocal2_gain,
|
| 942 |
+
echo_delay,
|
| 943 |
+
echo_feedback,
|
| 944 |
+
echo_mix,
|
| 945 |
+
reverb_rm_size,
|
| 946 |
+
reverb_width,
|
| 947 |
+
reverb_wet,
|
| 948 |
+
reverb_dry,
|
| 949 |
+
reverb_damping,
|
| 950 |
+
chorus_rate_hz,
|
| 951 |
+
chorus_depth,
|
| 952 |
+
chorus_centre_delay_ms,
|
| 953 |
+
chorus_feedback,
|
| 954 |
+
chorus_mix,
|
| 955 |
+
compressor_ratio,
|
| 956 |
+
compressor_threshold,
|
| 957 |
+
compressor_attack,
|
| 958 |
+
compressor_release,
|
| 959 |
+
noise_gate_threshold,
|
| 960 |
+
noise_gate_ratio,
|
| 961 |
+
noise_gate_attack,
|
| 962 |
+
noise_gate_release
|
| 963 |
+
],
|
| 964 |
+
outputs=[generated_files_list, final_ai_cover]
|
| 965 |
+
)
|
| 966 |
+
|
| 967 |
+
remix_btn.click(
|
| 968 |
+
fn=remix_cover,
|
| 969 |
+
inputs=[
|
| 970 |
+
use_effects,
|
| 971 |
+
instrumental_gain,
|
| 972 |
+
vocal1_gain,
|
| 973 |
+
vocal2_gain,
|
| 974 |
+
echo_delay,
|
| 975 |
+
echo_feedback,
|
| 976 |
+
echo_mix,
|
| 977 |
+
reverb_rm_size,
|
| 978 |
+
reverb_width,
|
| 979 |
+
reverb_wet,
|
| 980 |
+
reverb_dry,
|
| 981 |
+
reverb_damping,
|
| 982 |
+
chorus_rate_hz,
|
| 983 |
+
chorus_depth,
|
| 984 |
+
chorus_centre_delay_ms,
|
| 985 |
+
chorus_feedback,
|
| 986 |
+
chorus_mix,
|
| 987 |
+
compressor_ratio,
|
| 988 |
+
compressor_threshold,
|
| 989 |
+
compressor_attack,
|
| 990 |
+
compressor_release,
|
| 991 |
+
noise_gate_threshold,
|
| 992 |
+
noise_gate_ratio,
|
| 993 |
+
noise_gate_attack,
|
| 994 |
+
noise_gate_release
|
| 995 |
+
],
|
| 996 |
+
outputs=[final_ai_cover]
|
| 997 |
+
)
|
| 998 |
+
else:
|
| 999 |
+
gr.Markdown(f"<center><h2>{t('vbach_required')}</h2></center>")
|