Description Usage Arguments Value References See Also Examples
Creates a sonify
object, which is a list
containing the data.frame
to be sonified, the
mappings of data to sound parameters, the scaling of
parameters, and additional options.
1 2 3 |
data |
a |
mapping |
a |
scales |
a |
sonlayers |
A single |
rendering |
character string containing the method
of rendering. Currently only the default, |
render_options |
A named list of rendering options to pass to the individual rendering type. |
A sonify
object, which contains what is needed to
render the object. If the object is completely specified,
it can by rendered simply by calling the print method for
the object (i.e. simply typing the name of the object at
the R prompt).
The syntax of sonify
objects is heavily based on
that of ggplot
objects in the ggplot2
package. See the ggplot2
web site for more information.
+.sonify
for interacting with sonify
objects; sonaes
for setting the mappings;
sonscaling
and scaleShortcuts
for creating the scalings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## A bare-bones sonify object, but one that cannot render
x <- sonify()
summary(x)
## Not run: x # Throws an error message
## A more complete specification
## for a sonify object that uses iris
## with Petal.Length mapped onto times
## between 0 and 10 seconds.
## and Petal.Width mapped onto pitches
## between pitch values 6 (110 Hz) and 8 (440 Hz),
x <- sonify(data=iris,
sonaes(time=Petal.Length, pitch=Petal.Width),
sonscaling(pitch=list(6, 8, linear.scale),
time=list(0, 10, linear.scale)),
sonlayers=shape_notes())
summary(x)
## Not run: x # outputs sound
## You can hear there is a cluster of low values at the beginning
## when both Petal.Width and Petal.Length are small, followed
## by a higher cluster.
## The same, created incrementally
## and with the "scale_" convenience functions
x <- sonify(iris)
x <- x + sonaes(time=Petal.Length, pitch=Petal.Width)
x <- x + shape_notes()
x <- x + scale_pitch_linear(6, 8) + scale_time_linear(0, 10)
summary(x)
## Not run: x # outputs sound
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.