Sound Transformer Data Compute is a Unity project for real-time, physically-based sound simulation using Finite-Difference Time-Domain (FDTD) methods. It models sound propagation, material effects, and interactive audio synthesis for games and research.
Features
Feature | Description |
---|---|
FDTD Sound Simulation | Real-time pressure and velocity field simulation on the GPU. |
Material Modeling | Supports air, steel, aluminum, wood, and water for realistic sound effects. |
Enhanced Sources | Trigger metallic, wooden, and liquid sounds with physical parameters. |
Audio Output | Direct synthesis to Unity's AudioSource with post-processing. |
Visualization | 3D grid and source visualization in the Unity Editor. |
Technical Details
- Compute Shaders: High-performance parallel simulation of sound fields.
- FDTD Math: Solves the 3D wave equation:
∂²p/∂t² = c² ∇²p
- Material Effects: Each grid cell can represent air, steel, wood, water, etc., affecting sound speed and damping.
- Source Modeling: Physical parameters (frequency, amplitude, damping, material, phase) for each sound source.
- Audio Sampling: Listener position mapped to simulation grid, spatial averaging for anti-aliasing.
- Post-Processing: Soft clipping, low-pass filtering, and simple reverb for natural audio output.
Reference
Based on research in FDTD sound simulation:
Finite-Difference Time-Domain Simulation of Sound Propagation in 3D
Getting Started
- Clone the repository:
git clone https://github.com/yourusername/SoundTransformerDataCompute.git
- Open in Unity 2022.3 or newer.
- Assign the
WaveBlenderSolver
andWaveBlenderDemo
scripts to GameObjects. - Assign the
WaveBlenderFDTD.compute
shader to the solver. - Press Play and interact using Space (metal), W (wood), Q (water drop).
License & Contributing
MIT License. Pull requests and issues welcome!