print.sonify: Print method for 'sonify' objects

View source: R/print.sonify.R

print.sonifyR Documentation

Print method for sonify objects

Description

Printing a sonify object renders it to sound (analogously to how printing ggplot objects renders them to screen in the ggplot2 package).

Usage

  ## S3 method for class 'sonify'
 print(x, ...)

Arguments

x

A sonify object

...

Additional optional arguments:

render_real_time

Render the sonification in real time? If TRUE, the sonification is rendered in real time (which is faster but may not work as well on slower computers); if FALSE the sonification is rendered to a file on disk before playing. The default behavior is given by the option “render_real_time”.

file

The file to render to (if render_real_time = FALSE). The default is a temporary file.

play

If rendering to a file, should the file then be played? Default is TRUE.

playout

If playing from a file, what channel should be used for output? This string is passed to the Csound -o option. Default is "dac", the default audio out.

Details

In interactive use, you can simply type the name of the sonify object to sonify it. In loops, functions, and source-ing use, however, you need to explicitly call print by using print(x) to print the object x.

Value

print.sonify is called for its side-effect, which is to actually render the object to a sound. It invisibly returns the length of the resulting sonification.

Note

By default, a rendering is saved to a file and then immediately played for compatibility with slower systems. If you have a faster computer and want to play the sonification as you render it, you can set options("render_real_time" = TRUE). (It is FALSE by default.)

See Also

sonify for the creation of these objects, sonsave for a convenience function that saves a sound file, sonopts for advanced and low-level rendering options


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