sonaes: Create mappings and parameters for sonification objects

View source: R/sonaes.R

sonaesR Documentation

Create mappings and parameters for sonification objects

Description

Creates a sonaes object, which is a list containing the desired mappings of data columns or constants onto each sound parameter. This is intended be added to a sonify object (or included in its construction).

Usage

  sonaes(...)

Arguments

...

Sonic parameter mappings, specific to the shape being rendered. All arguments must be named, with the argument names sonic parameters and the values either numeric values (to set the sonic parameter to that value as a constant) or a column of the data.frame that is to be sonified (with or without quotes).

Details

Setting sonic parameters to data.frame columns is the heart of making the sonification. The sound parameters that can be the arguments of sonaes depend on the kinds of layers present; see sonify for a list of the possible kinds of layers.

Value

A sonaes object, used in or added to a sonify object or sonlayer.

See Also

sonify. Also, see aes from the ggplot2 package, which inspired this function.

Examples

## Maps Petal.Width onto tempo,
## Sepal.Width onto pitch,
## and sets scalings
## (not terribly informative, since the order is
## arbitrary)
x <- sonify(iris, sonaes(tempo=Petal.Width,
            pitch=Sepal.Width)) + shape_scatter()
summary(x)
## Not run: x ## Quite long!

## Use a different tempo scaling than default
## to hear more of the data faster
## Not run: x + scale_tempo_continuous(c(300, 1000))

## Map Petal.Width onto 'time' instead
y <- x + sonaes(time=Petal.Width)
summary(y)
## Not run: y

## Seems clipped, so increase duration
## Not run: y + sonaes(dur=4)

statisfactions/playitbyr documentation built on Jan. 27, 2024, 1:33 p.m.