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

show(x, to, musescore)

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

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.

Value

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

Details

This function works in

  • RStudio

  • R Markdown files

  • Jupyter Notebooks

  • Shiny applications

  • R.app GUI

Examples

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