sonaes: Create mappings and parameters for sonification objects

Description Usage Arguments Details Value See Also Examples

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

1

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 or constant values is the heart of making the sonification happen and making it possible to render. But sonaes does not check to make sure that all mappings are filled in, since the user can add on more mappings (using +.sonify) interactively. However, this is checked by checkSonify when the object is to be rendered.

Also, every item that is mapped to a data.frame column in a sonify object must also have a scale associated with it before rendering; see sonscaling.

Value

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

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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_notes()
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_linear(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)

playitbyr documentation built on May 2, 2019, 6:08 p.m.

Related to sonaes in playitbyr...