Abstract
Environmental noise is a persistent challenge in shared environments where individual Active Noise Cancellation (ANC) is impractical. Traditional acoustic masking often requires high volumes that can be as intrusive as the noise itself. This paper introduces BNMusic, a novel framework that treats environmental noise not as a nuisance to be covered, but as a rhythmic foundation to be integrated. By employing a two-stage generative process involving noise-aligned music synthesis and psychoacoustic adaptive amplification, BNMusic creates personalized tracks that perceptually absorb background noise. Experimental results demonstrate that BNMusic outperforms existing generative baselines in both objective audio quality and subjective user preference.
1. Introduction
In shared spaces such as open offices, subway cars, or public lounges, environmental noise—ranging from the rhythmic thrum of a washing machine to the erratic chirping of birds—is a constant source of distraction. While ANC technology provides relief for headphone users, it cannot address group settings. The common alternative, acoustic masking, typically involves playing background music or white noise. However, when the masking audio clashes rhythmically or spectrally with the environment, users must increase the volume to uncomfortable levels to achieve effective masking.
BNMusic proposes a paradigm shift: "musical masking." Instead of fighting the noise, the system synthesizes music that is structurally aligned with the noise's pulse and frequency. By treating the noise as a percussive or textural element within a larger composition, the framework allows the noise to "disappear" into the music at lower, more comfortable volume levels.
2. The BNMusic Framework
The BNMusic system operates on mel-spectrogram representations of audio, treating the synthesis task as a specialized image-generation problem. The framework is divided into two primary stages.
2.1 Noise-Aligned Music Synthesis
The first stage focuses on creating a musical context that matches the environmental noise. The system identifies high-energy regions within the noise spectrogram and applies a modified Stable Diffusion model (based on Riffusion) through a two-step process:
- Outpainting: The model generates musical content around the identified noise regions. This step is crucial for establishing a rhythmic and harmonic structure that complements the existing noise.
- Inpainting: Once the context is established, the model reconstructs the content within the noise regions. This ensures the final track inherits the structural essence of the noise while replacing discordant elements with musical textures that align with the user's stylistic preferences.
2.2 Adaptive Amplification
To ensure the noise is effectively masked without excessive volume, BNMusic utilizes psychoacoustic principles. The system calculates a "masking threshold"—the specific intensity required at various frequencies to render the noise inaudible to the human ear. Rather than applying a global volume boost, the model uses gradient descent to find the minimal amplification factor ($\lambda$) necessary to meet this threshold. This frequency-specific approach maximizes the blending effect while maintaining a comfortable listening experience.
3. Experimental Setup
The researchers evaluated BNMusic using a diverse array of noise and music sources:
- Noise Data: 1,000 segments from EPIC-SOUNDS (everyday actions) and 300 segments from ESC-50 (environmental sounds like rain or wind).
- Music Foundation: MusicBench provided over 3,400 high-quality tracks for training and baseline comparison.
- Personalization: To test the system's ability to generate personalized content, 100 LLM-generated prompts were used across seven genres, including Pop, EDM, Rock, Hip-hop, Punk, Jazz, and Classical.
4. Results and Discussion
BNMusic was compared against several state-of-the-art models, including MusicGen and standard Riffusion audio-to-audio modes.
4.1 Quantitative and Qualitative Performance
Objective metrics showed that BNMusic achieved the lowest Fréchet Audio Distance (FAD) and Kullback-Leibler (KL) divergence scores, indicating that its outputs were statistically closer to high-quality, professional music than the baselines. In subjective listening tests, participants rated BNMusic highest in Overall Quality (OVL) and lowest in Perceived Noise Level (PER). These results suggest that the "blending" approach is significantly more effective than simply overlaying music on top of noise.
4.2 Efficiency
The optimization for adaptive amplification is highly efficient, taking approximately 0.28 seconds. However, the diffusion-based generation process currently requires several seconds on an Nvidia 4090 GPU, representing a hurdle for real-time applications.
5. Conclusion and Future Work
BNMusic demonstrates that environmental noise can be effectively mitigated by treating it as a rhythmic bridge rather than a distraction. By forcing generative models to "outpaint" around noise, the resulting audio naturally adopts the environment's pulse.
Future work will focus on three areas: reducing latency through model distillation to enable live noise blending, improving prompt compatibility for high-contrast noise-genre pairs (e.g., masking industrial noise with soft classical music), and utilizing advanced neural vocoders to replace Griffin-Lim reconstruction, thereby reducing audio artifacts and improving overall crispness.
Summary updated