All Projects → lockepatton → sonipy

lockepatton / sonipy

Licence: MIT License
Sonification tool for turning scatter plots into perceptually uniform sound files for science and science access.

Programming Languages

python
139335 projects - #7 most used programming language
TeX
3793 projects

Projects that are alternatives of or similar to sonipy

WereSoCool
A language for composing microtonal music built in Rust. Make cool sounds. Impress your friends/pets/plants.
Stars: ✭ 41 (+105%)
Mutual labels:  sound, sound-processing, sonification, sound-synthesis
astronify
Astronomical data sonification.
Stars: ✭ 57 (+185%)
Mutual labels:  astronomy, sonification
pydiogment
📣 Python library for audio augmentation
Stars: ✭ 64 (+220%)
Mutual labels:  sound, sound-processing
soundtransform
Android & Pure Java library for sound manipulation
Stars: ✭ 42 (+110%)
Mutual labels:  sound, sound-processing
ArduinoProtonPack
Arduino Code for a GhostBusters Proton Pack
Stars: ✭ 57 (+185%)
Mutual labels:  sound
astro
自用天文算法,公历农历转换、八大行星位置、日出日落月出月落时间、节气物候时间等
Stars: ✭ 33 (+65%)
Mutual labels:  astronomy
school2021
ESCAPE Summer School 2021
Stars: ✭ 241 (+1105%)
Mutual labels:  astronomy
AASTeX60
Version 6 of the LaTeX style files and documentation for authoring AAS Journal (AJ/ApJ) articles.
Stars: ✭ 40 (+100%)
Mutual labels:  astronomy
bg-sound
Web Component to emulate the old-school <bgsound> HTML element
Stars: ✭ 93 (+365%)
Mutual labels:  sound
SoundProcesses
A computer music framework to describe, create and manage sound processes in the Scala programming language. Issue tracker: https://codeberg.org/sciss/SoundProcesses/issues
Stars: ✭ 29 (+45%)
Mutual labels:  sound
RTspice
A real-time netlist based audio circuit plugin
Stars: ✭ 51 (+155%)
Mutual labels:  sound-processing
DMXOPL
YMF262-enhanced FM patch set for Doom and source ports.
Stars: ✭ 42 (+110%)
Mutual labels:  sound
timbre painting
Hierarchical fast and high-fidelity audio generation
Stars: ✭ 67 (+235%)
Mutual labels:  sound
OACAPI
Open Astronomy Catalog API
Stars: ✭ 58 (+190%)
Mutual labels:  astronomy
astroalign
A tool to align astronomical images based on asterism matching
Stars: ✭ 102 (+410%)
Mutual labels:  astronomy
astromodels
Spatial and spectral models for astrophysics
Stars: ✭ 21 (+5%)
Mutual labels:  astronomy
AudioFile
Audiofile library for Scala.
Stars: ✭ 20 (+0%)
Mutual labels:  sound
orbital-sim
A simple physics engine build over a PyGame simulation to accurately model planetary orbits in space
Stars: ✭ 31 (+55%)
Mutual labels:  astronomy
pymeeus
Library of astronomical algorithms in Python
Stars: ✭ 25 (+25%)
Mutual labels:  astronomy
Simple-Unity-Audio-Manager
A decentralized audio playing system for Unity, designed for simplicity and built to scale!
Stars: ✭ 100 (+400%)
Mutual labels:  sound

soni-py : A Scatterplot Sonification Package

MIT License nbviewer Binder Documentation Status Build Status

A package to turn scatter plots into perceptually uniform sound files for use in science and to make science more accessible. This package should not be confused with SoniPy a sonification python module package by David Warrall, which can be found here.

This project was developed by Locke Patton and Prof. Emily Levesque. Click here for a twitter thread explaining the motivation behind this project.

What does soni-py do?

Here is an example sonification.

Our method of sonification takes in scatterplot data and produces audio clips that depict each datapoint as a short sound blip with a y value corresponding to pitch and an x value corresponding to arrival time.

soni-py setup

Each data point has a corresponding short tone called a blip, with a y value corresponding to its pitch and a x value corresponding to its arrival time. Higher y value data points have higher corresponding blip pitches.

Installation

soni-py is pip-installable from command line, as follows:

pip install sonipy

Alternately, you can clone the repository and install it yourself, also in command line:

git clone https://github.com/lockepatton/sonipy.git
cd sonipy
python setup.py install

Example Easy Setup

For two arrays of the same length, called x and y, you can sonify them using the following:

from sonipy.sonify import SonifyTool

Tone = SonifyTool(x, y)
Tone.play()
Tone.save()

Extended Setup

If you would like more fine control of the sonification inputs, you can adjust the underlying arguments as follows. For details about the parameters involved, see the Parameter Inputs section below.

from sonipy.sonify import SonifyTool

C4 = 261.6 # Hz
frequency_args = {
  'frequency_min' : C4,
  'frequency_max' : C4*4
  # 'cents_per_value' : -680,
  # 'value_min' : 0,
  # 'value_max' : 1,
}

duration_args = {
  'time_total' : 2000, # ms
  # 'time_min' : 100, # ms
  # 'time_max' : 800, # ms
}

duration_scale = 1. / 2000. # x value / time (ms)

Tone = SonifyTool(x, y,
                  frequency_args = frequency_args,
                  duration_args = duration_args,
                  # duration_scale = duration_scale,
                  bliplength=0.5)

Tone.play()
Tone.SaveTone()

Parameter Inputs

Frequency Scale Parameters:

All frequency parameters are entered inside the frequency_args parameter. The following inputs are all accepted.

  1. a minimum frequency and it's corresponding minimum y value
  2. a maximum frequency and it's corresponding maximum y value
  3. a change in pitch (measured in cents) over change in y value parameter

Time Scale Parameters:

By default, the sound files are 2 seconds. Time parameters are entered by simply by defining a duration_scale (in seconds per x value). Or alternately by passing a duration_args dictionary with some total time, smallest delta time between points or max delta time between points.

  1. a total time of the soundfile
  2. a change in time (measured in seconds) over change in x value parameter

Demos

Several Jupyter notebook demos that demonstrate some use cases and examples of sonipy are found here, with an interactive version found here.

TransientZoo Motivation

This code was developed as part of TransientZoo, a citizen science program that will allow participants, including blind and visually impaired individuals, to classify supernova lightcurves using sound. In astronomy, lightcurves depict variations in brightness of a specific astrophysical object as a function of time. For more, see this summary twitter thread and poster from the 235th American Astronomical Meeting.

Special Thanks

Thank you to Prof. Allen Downey for permission to host his thinkDSP code in this repository for easier distribution. This work wouldn't be possible without it. For more details about his book Think DSP: Digital Signal Processing in Python, see his textbook repository at https://github.com/AllenDowney/ThinkDSP.

Reach Out

Work on this project is welcomed. For more information on contributing, see our contributing.md guidelines.

Have an issue with your operating system or any other suggestions/improvements? Let us know by opening an issue! Have a suggestion for how to make this code more accessible? Send Locke an email at [email protected] or reach out via a github issue.

Attribution

If you find the package useful in your research, please cite our JOSS paper.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].