playitbyr Getting Started Support--Help, Bugs, and Documentation GitHub Sonification Resources

Play it by R: Data through Sound

What's your data saying? The playitbyr package for the lovely R statistics & data environment allows you to listen to a data.frame in R by mapping columns onto sonic parameters, creating an auditory graph. Many clever people have developed tools and interfaces for sonification, but there's just not that much out there to sonify straight from a statistics package. Here's how to get started.

playitbyr 0.2-1 works arm-in-arm with the venerable Csound synthesizer to bring you wild new sounds:

## All four measurements of the iris datasets, mapped on to pitch, time, modulation frequency, index of modulation
sonify(iris, sonaes(time = Petal.Length, pitch = Petal.Width, mod = Sepal.Length, indx = Sepal.Width)) + shape_scatter() +
scale_time_continuous(c(0, 10)) + scale_pitch_continuous(c(7, 12))

## An audio boxplot: distribution of Sepal.Length in iris dataset
## Pitch varies full range, then interquartile range (25% to 75%),
## then median, for setosa, versicolor, virginica
sonify(iris, sonaes(pitch = Sepal.Length, indx = Species)) + sonfacet(Species) + shape_boxplot(length = 1, tempo = 1800)

## An audio dotplot of the same
sonify(iris, sonaes(time = Sepal.Length)) + shape_dotplot(jitter = 0.3) + sonfacet(Species)

To make sonification easier to learn, the package mimics the syntax of the popular and beautiful ggplot2 package. sonify objects, created by the sonify() function, contain both the data to be sonified and the mappings and scalings of the sound parameters. Users can tweak their sonification by adding other mappings, scalings, facets, and data to the mix.

One of the first experiments in sonification for statistical exploration was at Bell Labs in 1977, a collaboration which included John Chambers and Max Matthews. John Chambers created S, and Max Mathews worked on the groundbreaking MUSIC. Isn't it fitting that their open-source children, R and Csound, should decide to cozy up once again?

Back to top