SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2508.03448 · ICML · 2025

SonicMaster: Towards Controllable All-in-One Music Restoration and Mastering

Dorien Herremans, Jan Melechovsky, Ambuj Mehrish, Abhinaba Roy

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 3 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2508.03448.json · badge: /api/ran/2508.03448.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
AMAAI-Lab/SonicMaster canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
FunctionStatusWhere it lives
choose_degradation Ran
ran; our contract draft was wrong, not the code
AMAAI-Lab/SonicMaster/dataset_scripts/degrade_final.py
code served (permissive licence) · get_code("a509498f6984c407")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import random

# Set seed for reproducibility
random.seed(0)

# The function choose_degradation takes two boolean parameters
# stereo_ok: whether stereo degradation is allowed (default True)
# vocal_enable: whether vocal EQ option is enabled (default True)

ARGS = {
    'stereo_ok': True,
    'vocal_enable': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clip_audio Ran
ran, violated the contract we drafted
AMAAI-Lab/SonicMaster/dataset_scripts/deg_functions.py
code served (permissive licence) · get_code("3edb72e9e08ca8a5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (8,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small audio array with values outside [-1.0, 1.0]
# to demonstrate the clipping functionality
audio = np.array([-2.5, -0.5, 0.0, 0.5, 1.5, 2.0, -1.2, 0.8], dtype=np.float32)

ARGS = {
    "audio": audio
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (8,) — shape (8,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clip_audio_choice Ran
ran, violated the contract we drafted
AMAAI-Lab/SonicMaster/dataset_scripts/deg_functions.py
code served (permissive licence) · get_code("c4e796a569df840e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (8,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample audio data - a small numpy array
audio = np.array([0.5, -0.3, 0.8, -0.2, 0.1, -0.9, 0.4, 0.6], dtype=np.float32)

# Create amplitude parameter
amplitude = 0.75

ARGS = {
    "audio": audio,
    "amplitude": amplitude,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (8,) — shape (8,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
coeff_exponential Ran
ran, honoured the contract we drafted
AMAAI-Lab/SonicMaster/dataset_scripts/compressor.py
code served (permissive licence) · get_code("a56fd5d624ea9e91")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def coeff_exponential(ms, sample_rate=44100.0):
    time_in_samples = ms * sample_rate / 1000.0
    return math.exp(-1.0 / time_in_samples)

ARGS = {
    "ms": 100.0,
    "sample_rate": 44100.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize Ran
ran, violated the contract we drafted
AMAAI-Lab/SonicMaster/dataset_scripts/deg_functions.py
code served (permissive licence) · get_code("eadd954e7280955f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small audio array
audio = np.array([0.5, -0.3, 0.8, -0.2, 0.1])

ARGS = {
    "audio": audio
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_wav Ran
ran; our contract draft was wrong, not the code
AMAAI-Lab/SonicMaster/utils.py
code served (permissive licence) · get_code("840ad483fdc083ab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small waveform tensor
# The function expects a tensor that can be normalized
waveform = torch.randn(2, 4)

ARGS = {
    "waveform": waveform
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pad_wav Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AMAAI-Lab/SonicMaster/utils.py
code served (permissive licence) · get_code("c900bf2a613b2a7f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (8,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small waveform tensor
waveform = torch.randn(5)

# Define segment_length
segment_length = 8

ARGS = {
    "waveform": waveform,
    "segment_length": segment_length,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (8,) — shape (8,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
retrieve_timesteps Ran
ran; our contract draft was wrong, not the code
AMAAI-Lab/SonicMaster/model.py
code served (permissive licence) · get_code("59b1e128b0f382eb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import inspect

class MockScheduler:
    """Mock scheduler that supports set_timesteps with num_inference_steps, timesteps, and sigmas"""
    def __init__(self):
        self.timesteps = torch.tensor([999, 500, 100, 0])
        self.sigmas = None
    
    def set_timesteps(self, num_inference_steps=None, device=None, timesteps=None, sigmas=None, **kwargs):
        if timesteps is not None:
            self.timesteps = torch.tensor(timesteps, device=device)
        elif sigmas is not None:
            # Create timesteps based on sigmas
            self.timesteps = torch.tensor([999, 500, 100, 0], device=device)
            self.sigmas = sigmas
        else:
            # Create default timesteps based on num_inference_steps
            self.timesteps = torch.linspace(999, 0, num_inference_steps, dtype=torch.long, device=device)

torch.manual_seed(0)

scheduler = MockScheduler()

ARGS = {
    "scheduler": scheduler,
    "num_inference_steps": 4,
    "device": "cpu",
    "timesteps": None,
    "sigmas": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rk4_step Ran
ran; our contract draft was wrong, not the code
AMAAI-Lab/SonicMaster/model.py
code served (permissive licence) · get_code("f6edf947ba5c074e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that matches the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, hidden_states, timestep, encoder_hidden_states, pooled_projections, txt_ids, img_ids, guidance, return_dict=False):
        # The function expects a tuple output where [0] is the velocity prediction
        # hidden_states shape: (batch_size, latent_dim) or (2*batch_size, latent_dim) with cfg
        batch_size = hidden_states.shape[0]
        velo_pred = self.linear(hidden_states)
        return (velo_pred,)

# Create model
model = MinimalModel()

# Define arguments
ARGS = {
    "latents": torch.randn(2, 4),  # batch_size=2, latent_dim=4
    "t": torch.tensor(0.5),  # scalar timestep
    "dt": 0.1,  # float timestep size
    "model": model,  # nn.Module instance
    "batch_size": 2,
    "encoder_hidden_states": torch.randn(2, 3, 8),  # (batch_size, seq_len, hidden_dim)
    "pooled_projection": torch.randn(2, 8),  # (batch_size, proj_dim)
    "txt_ids": torch.randint(0, 100, (2, 3)),  # (batch_size, seq_len)
    "audio_ids": torch.randint(0, 100, (2, 3)),  # (batch_size, seq_len)
    "device": torch.device("cpu"),
    "classifier_free_guidance": False,
    "guidance_scale": 1.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample_linear_plus_uniform Ran
ran, honoured the contract we drafted
AMAAI-Lab/SonicMaster/utils.py
code served (permissive licence) · get_code("0bd124f1d6333bb3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'batch_size': 2,
    'skew_toward': 'start',
    'uniform_weight': 0.5,
    'device': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 1 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
retrieve_timesteps 46 other papers
30 dated earlier, 1 the same month, 12 later, 1 same year, order not determinable, 2 undated
2312.04461 (2023-12)
PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding
2402.10491 (2024-02)
Make a Cheap Scaling: A Self-Cascade Diffusion Model for Higher-Resolution Adaptation
2405.18991 (2024-05)
EasyAnimate: High-Performance Video Generation Framework with Hybrid Windows Attention and Reward Backpropagation
and 43 more not named here
normalize_wav 1 other paper
1 dated earlier
2407.02869 (2024-07)
PicoAudio: Enabling Precise Timestamp and Frequency Controllability of Audio Events in Text-to-audio Generation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Music recordings often suffer from audio quality issues such as excessive reverberation, distortion, clipping, tonal imbalances, and a narrowed stereo image, especially when created in non-professional settings without specialized equipment or expertise. These problems are typically corrected using separate specialized tools and manual adjustments. In this paper, we introduce SonicMaster, the first unified generative model for music restoration and mastering that addresses a broad spectrum of audio artifacts with text-based control. SonicMaster is conditioned on natural language instructions to apply targeted enhancements, or can operate in an automatic mode for general restoration. To train this model, we construct the SonicMaster dataset, a large dataset of paired degraded and high-quality tracks by simulating common degradation types with nineteen degradation functions belonging to five enhancements groups: equalization, dynamics, reverb, amplitude, and stereo. Our approach leverages a flow-matching generative training paradigm to learn an audio transformation that maps degraded inputs to their cleaned, mastered versions guided by text prompts. Objective audio quality metrics demonstrate that SonicMaster significantly improves sound quality across all artifact categories. Furthermore, subjective listening tests confirm that listeners prefer SonicMaster's enhanced outputs over other baselines. The model and demo samples are available through https://github.com/AMAAI-Lab/SonicMaster.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2508.03448")
get_code_for_paper("2508.03448")
have("2508.03448")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2508.03448.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2508.03448.svg)](https://syntology.ai/paper/2508.03448)

Connect an agent — have() is free.