Learn R Programming

gm (version 2.0.0)

show: Show Music Object

Description

Display a Music object as a music score or audio file.

Usage

show(x, to, musescore)

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

Value

An invisible NULL. A music score or audio file will be displayed.

Arguments

x

A Music object.

to

Optional. A character vector, which can be "score", "audio", or both. It specifies the output format. By default, both are displayed. You can change the default behavior by setting the gm.show_to option with options().

musescore

Optional. A character vector, which represents the command line options passed to MuseScore. See MuseScore command line usage for details.

Details

This function works in

  • RStudio

  • R Markdown files

  • Jupyter Notebooks

  • Shiny applications

  • R.app GUI

Examples

Run this code
if (interactive()) {
  music <- Music() + Meter(4, 4) + Line("C4")
  show(music, musescore = "-r 800 -T 5")
}

Run the code above in your browser using DataLab