A data sonification tool that converts quantum physics data (specifically Rabi oscillation patterns) into sound. This project allows you to explore different methods of sonification through an interactive Streamlit dashboard.
This application provides multiple sonification strategies to transform data into sound:
- Sine Wave: Maps data to simple sine wave tones
- FM Synthesis: Uses frequency modulation for more complex sounds
- Granular Synthesis: Creates textural sounds from small sound "grains"
- Harmonic Mapping: Maps data to harmonic content for rich timbral variations
- Euclidean Distance: Sonifies the distance between consecutive data points
The dashboard also includes data visualization tools to help you understand your data before sonifying it.
Currently it's assumed that the X will be time (or analogous), and the Y will be the data to sonify.
The dashboard is hosted on Streamlit Cloud at https://xy-sonification.streamlit.app/
Option 1: Using Docker (Recommended)
Prerequisites:
- Docker installed on your system
Steps:
-
Clone this repository:
git clone https://github.com/rorads/xy-sonification.git cd xy-sonification -
Build and run the Docker container:
make up
This will build the Docker image and start a container running the Streamlit app.
-
Access the dashboard in your browser at:
http://localhost:8501
Other useful Docker commands:
make logs # View container logs
make stop # Stop and remove the container
make clean # Remove container and imageOption 2: Running Directly with Streamlit
Prerequisites:
- Python 3.12+
- pip or uv package manager
Steps:
-
Clone this repository:
git clone https://github.com/rorads/xy-sonification.git cd xy-sonification -
Create and activate a virtual environment:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
uv sync
-
Run the Streamlit app:
streamlit run dashboard.py
-
Access the dashboard in your browser at:
http://localhost:8501
- When you first open the dashboard, it will use the default dataset (
fig3b_multilevel.csv). - Explore the data in the "Data Exploration" tab, which shows statistics and visualizations.
- Switch to the "Sonification" tab to convert the data to sound.
- Select a sonification method from the sidebar.
- Adjust parameters to change how the data is sonified.
- Click the "Generate" button to create and play the audio.
- Download the generated audio file for further use.
The application expects CSV files with at least two columns:
- The first column is typically a time or x-coordinate value
- The second column is the data to be sonified (typically y-coordinate values)
Example:
microseconds, optical_contrast
1.500000000000000118e-02, -4.925499858765510774e-01
1.750000000000000167e-02, -4.933005565083004584e-01
2.000000000000000042e-02, -6.617802563678457650e-01dashboard.py- Main Streamlit applicationdata/- Contains sample data filesDockerfile&Makefile- For containerization and automation
- streamlit
- numpy
- pandas
- matplotlib
- librosa
- scipy
- and others (see
pyproject.tomlfor full list)
MIT

