show {gm}R Documentation

Show Object

Description

Show an object as musical score or audio file.

Usage

show(x, to)

## S3 method for class 'Music'
show(x, to = NULL)

Arguments

x

An object.

to

Optional. A character vector which contains "score", "audio" or both, which indicates whether to show the object as musical score or audio file. The default value is "score".

Value

Invisible NULL.

The generated musical score or audio file is

  1. showed in Viewer panel if show is called in RStudio,

  2. included in generated HTML file if called in R Markdown document,

  3. showed in output cell if called in R Jupyter Notebook, and

  4. showed in user's browser if called in a normal R console.

Methods (by class)

Examples

if (interactive()) {
  m <- Music() + Meter(4, 4) + Line(list("C4"), list(4))
  show(m, c("score", "audio"))
}

[Package gm version 1.0.2 Index]